tags:

views:

79

answers:

1

Hi I am trying to implement ajax to my struts2 application using the DWR . while configuring DWR i need to make the theme of the form as ajax . I am using struts2-core2.1.6.jar in which it did not have the ajax theme at all , the template folder has the css_xhtml,simple,xhtml and archive themes

I have made all the congfigurations for the DWR except making the theme as ajax to the Form . if i make the theme as ajax to the Form then i am getting the following exception

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: org.apache.jasper.JasperException: Template /template/ajax/text.ftl not found. - Class: freemarker.template.Configuration
File: Configuration.java
Method: getTemplate
Line: 489 - freemarker/template/Configuration.java:489:-1
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:491)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:401)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:73)

root cause

org.apache.jasper.JasperException: Template /template/ajax/text.ftl not found. - Class: freemarker.template.Configuration
File: Configuration.java
Method: getTemplate
Line: 489 - freemarker/template/Configuration.java:489:-1
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:527)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
org.apache.jsp.contactus.contactus_jsp._jspService(contactus_jsp.java:94)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:73)

root cause

Template /template/ajax/text.ftl not found. - Class: freemarker.template.Configuration
File: Configuration.java
Method: getTemplate
Line: 489 - freemarker/template/Configuration.java:489:-1
org.apache.struts2.components.UIBean.end(UIBean.java:515)
org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
org.apache.jsp.contactus.contactcontent_jsp._jspx_meth_s_005ftextfield_005f0(contactcontent_jsp.java:421)
org.apache.jsp.contactus.contactcontent_jsp._jspx_meth_s_005fform_005f0(contactcontent_jsp.java:326)
org.apache.jsp.contactus.contactcontent_jsp._jspService(contactcontent_jsp.java:157)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
org.apache.jsp.contactus.contactus_jsp._jspService(contactus_jsp.java:94)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:73)

root cause

java.io.FileNotFoundException: Template /template/ajax/text.ftl not found.
freemarker.template.Configuration.getTemplate(Configuration.java:489)
freemarker.template.Configuration.getTemplate(Configuration.java:452)
org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:120)
org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:559)
org.apache.struts2.components.UIBean.end(UIBean.java:513)
org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
org.apache.jsp.contactus.contactcontent_jsp._jspx_meth_s_005ftextfield_005f0(contactcontent_jsp.java:421)
org.apache.jsp.contactus.contactcontent_jsp._jspx_meth_s_005fform_005f0(contactcontent_jsp.java:326)
org.apache.jsp.contactus.contactcontent_jsp._jspService(contactcontent_jsp.java:157)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
org.apache.jsp.contactus.contactus_jsp._jspService(contactus_jsp.java:94)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:73)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.26 logs.
Apache Tomcat/6.0.26

how do i solve this ?

A: 

You can create in struts your own theme. Just add/modify the .ftl files in the right folder. For a netbeans project create WEB-INF/classes/template/foo and put the templates you need in there.

For detailed information read the last part of Integrate struts2 into netbeans

Psyconn