wood burning stoves*
The moose likes Struts and the fly likes bean:message  - existing key value not found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "bean:message  - existing key value not found" Watch "bean:message  - existing key value not found" New topic
Author

bean:message - existing key value not found

Rich Smyth
Ranch Hand

Joined: May 30, 2002
Posts: 87
I am learning struts 1.0.2 with Apache 4.1.18.
In my webapp's web.xml I specified a resource properties file. This property file contains an index.title entry yet when I try to run the app in my IE browser I get a Http 500 error with the JasperException message "Missing message for key index.title"
While debugging I discoved that if I put an non-existant property file in my web.xml the Apache log still reports that the "application resources were loaded using" the non-existant property file. My property file is under yhe WEB-INF/classes/mypackage directory. Is this correct?
Can you suggest another area to investigate (I'm sure I don't have a typo).
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
If your web.xml says something like:
<init-param>
<param-name>application</param-name>
<param-value>ApplicationResources</param-value>
</init-param>
then your app will be looking for ApplicationResources.properties in "WEB-INF\classes".
HTH
Rich Smyth
Ranch Hand

Joined: May 30, 2002
Posts: 87
I placed my source code in the default package. My web.xml specifies the resource property file as you described and my property file is in WEB-INF/classes. Still I have no luck finding my key value.
I inserted the <logic:notPresent> tag to test that my resources were in fact loaded ( tag code taken from the struts-example) and the test did not detect an error.
I could really use a tip on what I could test next to resolve this.
Rich
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
Can we see the code in your jsp as well as your properties file?
Rich Smyth
Ranch Hand

Joined: May 30, 2002
Posts: 87
My jsp, property file, and web.xml are posted below(I hope the formatting comes out ok):
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450

Try removing ".properties" from the end of "RegisterUserResources" in the above code.
Also, this is probably just a typo, and if you are running on a Windows platform it might not even matter (not sure to be honest), but in part of the code you showed you referenced a "registerUserResources.properties" however your web.xml refers to "RegisterUserResources" with a capital "R".
[ January 13, 2003: Message edited by: Jason Menard ]
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
I may be wrong on this, but I believe the resource bundle is case sensitive. Check to make sure that the init-param in the web.xml file matches the case of the file name.


Matthew Phillips
Rich Smyth
Ranch Hand

Joined: May 30, 2002
Posts: 87
Thank you Jason!
I had to remove the .properties from the 'application' <param-value> in my web.xml
I will not forget this errorl. (nor will I have complete faith in tutorials on the web
)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: bean:message - existing key value not found