File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Message Resource 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 "Message Resource" Watch "Message Resource" New topic
Author

Message Resource

Ravi Seshu
Ranch Hand

Joined: Mar 19, 2005
Posts: 38
HI, i have a problem loading Message Resource file. I created an application, added message-resource tag in struts-config.xml, located applicationresource.properties there..., i used <bean:message key="abc.def"/>
whose value is defined in properties file but properties file is not loaded properly..is there anyother way

any help is greatly appreciated..
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Is your ApplicationResources.properties file located in the WEB-INF/classes directory? It would help if you'd show us:

* the message-resource tag in your Struts-config.xml file
* A representation of the folder tree showing where your ApplicationResources.properties file is located.

Also, see this thread.
[ April 12, 2006: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
Ravi Seshu
Ranch Hand

Joined: Mar 19, 2005
Posts: 38
Hi,
yes my application-res.prop file is located in /web-ing/app-res.prop, and i located that in message-resource tag in struts-config.xml,is this process right???

i wnt to run sample application with struts so..how can i make tis applicaton prop tile avaliable to my jsp : <bean:message tag?? can u tell me the process..: did i do write or anytin to be modified...

-eswar
sweta naidu
Greenhorn

Joined: Nov 02, 2004
Posts: 25
Make sure you included struts-bean tag in JSP.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Make sure your <message-resources> tag reads:

<message-resources>ApplicationResources</message-resources>

NOT

<message-resources>ApplicationResources.properties</message-resources>
Ravi Seshu
Ranch Hand

Joined: Mar 19, 2005
Posts: 38
hi,
i put it in <message-resources null="false" parameter="/WEB-INF/ApplicationResources.properties" /> in struts-config.xml

is that ok...

-eswar
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
No, it is not OK.

Struts must be able to find this file in it's classpath. Therefore, it must be in the /WEB-INF/classes directory or one of it's subdirectories.

Secondly, you should not put .properties at the end. You are telling Struts to look for a Resource Bundle, not a file. If you're using internationalization, there will be several ApplicationProperties_xx_xx.properties files.

In summary, put the ApplicationResources.properties file in WEB-INF/classes, and specify

<message-resources>ApplicationResources</message-resources>

in your struts-config.xml file.
[ April 17, 2006: Message edited by: Merrill Higginson ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Message Resource