返回列表
发帖
爱琴涟漪
楼主:爱琴涟漪 发表于 2011-03-30 14:23 [回复8次/有效7个,浏览321次]
struts2.1.8 整合DWR出错 请高人指点 在线等待
已经添加了如下jar包:
1)commons-fileupload-1.2.1.jar
2)commons-logging-1.0.4.jar
3)dwr-1.1.1.jar
4)freemarker-2.3.15.jar
5)json-lib-2.1.jar
6)ognl-2.7.3.jar
7)struts2-core-2.1.8.1.jar
8)struts2-dojo-plugin-2.1.8.1.jar
9)struts2-dwr-plugin-2.1.8.1.jar
10)xwork-core-2.1.6.jar
错误提示
严重: Could not load the FreeMarker template named 'form':
2010-8-1 11:10:58 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
严重: Attempted: /template/ajax/form.ftl
2010-8-1 11:10:58 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
严重: The TemplateLoader provided by the FreeMarker Configuration was a: freemarker.cache.MultiTemplateLoader
2010-8-1 11:10:58 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
严重: Could not open template
java.io.FileNotFoundException: Template /template/ajax/form.ftl not found.
at freemarker.template.Configuration.getTemplate(Configuration.java:489)
at freemarker.template.Configuration.getTemplate(Configuration.java:452)
at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:120)
at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:559)
...(Http11AprProtocol.java:579)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)
at java.lang.Thread.run(Thread.java:619)
java.io.FileNotFoundException: Template /template/ajax/form.ftl not found.
at freemarker.template.Configuration.getTemplate(Configuration.java:489)
at freemarker.template.Configuration.getTemplate(Configuration.java:452)
at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:120)
at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:559)
...
(Http11AprProtocol.java:579)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)
at java.lang.Thread.run(Thread.java:619)
2010-8-1 11:10:58 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
严重: Could not load the FreeMarker template named 'text':
2010-8-1 11:10:58 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
严重: Attempted: /template/ajax/text.ftl
2010-8-1 11:10:58 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
严重: The TemplateLoader provided by the FreeMarker Configuration was a: freemarker.cache.MultiTemplateLoader
2010-8-1 11:10:58 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet jsp threw exception
java.io.FileNotFoundException: Template /template/ajax/text.ftl not found.
at freemarker.template.Configuration.getTemplate(Configuration.java:489)
at freemarker.template.Configuration.getTemplate(Configuration.java:452)
at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:120)
以下是我的代码及文件。
1)struts.xml
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
/reg-ajax.jsp
2)dwr.xml
"-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
"http://www.getahead.ltd.uk/dwr/dwr10.dtd">
import java.util.Map;
import org.apache.struts2.validators.DWRValidator;
DWRValidator.doPost(String, String, Map);
]]>
3)reg-ajax.jsp
4)web.xml
dwr
uk.ltd.getahead.dwr.DWRServlet
debug
true
dwr
/dwr/*
struts2
org.apache.struts2.dispatcher.FilterDispatcher
struts2
/*
曹雨婷
2楼 发表于 2011-03-30 14:35
validate="true"也去掉
twg_zhj
3楼 发表于 2011-03-30 14:45
这个form.tld文件没有导入,你在jar包中解压出来访问web-inf下即可
请问/template/ajax/form.ftl在哪个包中?
xiao2ai
4楼 发表于 2011-03-30 14:47
遇到同样的问题
keke1996
5楼 发表于 2011-03-30 14:52
怎么结不了贴,
小鼠妈妈
6楼 发表于 2011-03-30 14:58
去掉 下面改用标签
咸鱼2008
7楼 发表于 2011-03-30 15:19
哪个地方啊》
HYJ0702
8楼 发表于 2011-03-30 15:51
我也遇到了这个问题,球高手