aspose file tools*
The moose likes Struts and the fly likes Beginner Struts problem....Can you suggest?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Beginner Struts problem....Can you suggest??" Watch "Beginner Struts problem....Can you suggest??" New topic
Author

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

Mishra Anshu
Ranch Hand

Joined: Sep 16, 2003
Posts: 224
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)


"Ignorance is bliss"
sandy gupta
Ranch Hand

Joined: Jan 30, 2001
Posts: 228
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"/>


Adios
Laura Bush
Greenhorn

Joined: Dec 04, 2003
Posts: 10
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.


SCJP 1.4 SCBCD SCWCD
Mishra Anshu
Ranch Hand

Joined: Sep 16, 2003
Posts: 224
Thanks Lara....
I'll tell you when I'll be through....
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Beginner Struts problem....Can you suggest??