I believe that the ApplicationResources must be in your classpath. You
cannot just set the file location in the web.xml file. Just the name.
The name could be something like this com.whatever.ApplicationResources.
-----Original Message-----
From: Jeff Corliss [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 08, 2002 3:24 PM
To: [EMAIL PROTECTED]
Subject: Missing message for key problem
Hi All,
Just starting with Struts, and I'm having a problem
where my messages resource is either not getting
loaded at all, or for some reason the struts
bean:message tag just isn't able to find the messages
for the given keys.
When I try to access the index.jsp for my app (which
is actually right now the struts example app's
index.jsp), I get the following error:
====================
Error: 500
Location: /myapp/index.jsp
Internal Servlet Error:
javax.servlet.ServletException: Missing message for
key index.title
...
with a root cause of:
javax.servlet.jsp.JspException: Missing message for
key index.title
at
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:242)
====================
This occurs on all message keys I have tried so far,
despite the fact that those message keys do exist in
the resource file. I'm using Tomcat 3.2.3 by the way.
The problem may be that I renamed and moved the
resource file, but I did indicate its new location and
name in the web.xml, as follows:
<!-- Standard Action Servlet Configuration (with
debugging) -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>application</param-name>
<param-value>/WEB-INF/resources/my_i18n.properties</param-value>
</init-param>
<init-param>
<param-name>null</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>validate</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
I have redeployed the app and stopped/restarted Tomcat
(many times now ;>), but still no go.
The ActionServlet does seem to startup ok because I
see in the Tomcat output log messages indicating that
it has setup my requested data source from the
struts-config and also the various mappings in the
config. I don't explicitly see it mention either
trying (nor failing) to load my resources file though.
I've built a debug servlet that lets me see all the
objects stored as attributes in the various scopes,
and I do see an object named
"org.apache.struts.action.MESSAGE" of type
org.apache.struts.util.PropertyMessageResources in the
application scope. So apparently it is there, but it
may be (somehow) empty.
Any ideas?
Thanks,
Jeff
__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/
--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>