aspose file tools*
The moose likes Struts and the fly likes Struts Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Exception" Watch "Struts Exception" New topic
Author

Struts Exception

Vijay Kumar
Ranch Hand

Joined: Jul 24, 2003
Posts: 260
Hi all it is a small jsp file . when I am trying to execute it its giving an exception.
JSP file





Exception:

HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

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

exception

javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1858)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:446)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

org.apache.jasper.JasperException: Cannot find message resources under key org.apache.struts.action.MESSAGE
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:99)
org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:82)
org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:51)
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:48)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:280)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1858)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:446)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause


web.xml file :

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<display-name>Welcome to Tomcat</display-name>
<description>
Welcome to Tomcat
</description>

<taglib>
<taglib-uri>/tags/struts-html</taglib-uri>
<taglib-location>/WEB-INF/tags/struts-html.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/tags/struts-bean</taglib-uri>
<taglib-location>/WEB-INF/tags/struts-bean.tld</taglib-location>
</taglib>

<servlet>
<servlet-name>action</servlet-name>
<servlet-class> org.apache.struts.action.ActionServlet </servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/tags/struts-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-app>


please suggest me for it.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Make sure you have the following entry in your struts-config.xml file:

<message-resources parameter="MessageResources" />

Also make sure the file MessageResources.properties is in your WEB-INF/classes directory and that it contains the message keys you've used in your JSP.

This link has some good tips on using message resource bundles in Struts.


Merrill
Consultant, Sima Solutions
Achalveer Singh
Greenhorn

Joined: Sep 22, 2006
Posts: 25
i think you have not given the defination of message.title in MessageResources.properties


ACHALVEER SINGH<br />SOFTWARE ENGINEER
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts Exception