File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Beginner Struts problem....Can you suggest??

 
Mishra Anshu
Ranch Hand
Posts: 224
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI!!!
I just got through tutorials for struts by Isabelle Hurbain.
I got everything right upto just before "A bit of internationization". After I make the , ApplicationResources.properties
and edit the index.jsp page I get the error as written below. I searched on some of the forum and
used

<message-resources parameter="ApplicationResources"/> in place of
<init-param>
<param-name>application</param-name>
<param-value>ApplicationResources</param-value>
</init-param> in the web.xml.
But got the same result. Can any body suggest , how to move further.

Thanks


exception
javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
org.apache.jsp.index_jsp._jspService(index_jsp.java:72)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

root cause
javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE
org.apache.struts.util.RequestUtils.retrieveMessageResources(RequestUtils.java:1103)
org.apache.struts.util.RequestUtils.message(RequestUtils.java:1043)
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:294)
org.apache.jsp.index_jsp._jspx_meth_bean_message_0(index_jsp.java:119)
org.apache.jsp.index_jsp._jspx_meth_html_html_0(index_jsp.java:91)
org.apache.jsp.index_jsp._jspService(index_jsp.java:64)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
 
sandy gupta
Ranch Hand
Posts: 228
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your application resources properties file needs to be defined in your struts-config.xml. Did you do that.
<message-resources
parameter="com.XXX.registration.ApplicationResources"/>
 
Laura Bush
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anshu,
I encountered the same problem. You donot have to change anything from the code given by Isabelle hurmain for this Internationalization problem.
All you have to dau is to just add an empty struts-config.xml into the WEB-INF directory with the following content:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
<struts-config></struts-config>
It worked for me when i added just that. Hope this helps. Let me know if you need further help.
 
Mishra Anshu
Ranch Hand
Posts: 224
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Lara....
I'll tell you when I'll be through....
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic