Attribute theme invalid for tag head according to TLD

来源:互联网 发布:秃子扳机数据图 编辑:程序博客网 时间:2024/05/17 22:48
在struts-2.2.3.1中加入<s:head theme="ajax"/>这个标签,报错
 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="sd" %>
后又出现异常Attribute theme invalid for tag head according to TLD
经过一下午的网上查询,终于找到答案了,至于异常原因也没明说,又将上面
页面上<sd:head theme="ajax" />改成下面这两行,其他的不用改:
<s:head theme="xhtml"/>
<sd:head parseContent="true"/>
问题解决了。希望遇到同样问题的朋友对你有所帮助。微笑


原创粉丝点击