在已經引入/MyStruts/WebRoot/WEB-INF/lib/struts2-dojo-plugin-2.1.8.jar包的情況下,如果我使用<s:head theme="ajax"/>,會拋如下異常: Class: freemarker.core.TemplateObject File: TemplateObject.java Method: assertNonNull如果我沒有引入struts2-dojo-plugin-2.1.8.jar包會拋出如下異常:Expression parameters.parseContent is undefined on line 45, column 28 in template/ajax/head.ftl. - Class: freemarker.core.TemplateObjectFile: TemplateObject.java出錯,後網上一查原因為出現此問題的原因:在jsp頁面用到了struts提供的ajax主題,但是聲明主題時出現問題,struts2.0到struts2.1有一個重要的改變就是對ajax支援的改變,struts2.0的ajax支援主要以DWR和dojo為主,並專門提供ajax主題,如:<s:head theme="ajax"/>,但是在struts2.1不在提供ajax主題,而將原來的ajax主題放入了dojo外掛程式中,我們需要將dojo標籤引入到jsp頁面,在改為<%@ taglib uri="/struts-tags" prefix="s" %> <%@ taglib uri="/struts-dojo-tags" prefix="sx" %><sx:head theme="ajax"/>會拋如下異常:後又出現異常Attribute theme invalid for tag head according to TLD解決辦法:<sx:head theme="ajax" />改成下面這兩行,其他的不用改:<s:head theme="xhtml"/><sx:head parseContent="true"/>