File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Message Resource

 
Ravi Seshu
Ranch Hand
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Ravi Seshu
Ranch Hand
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure you included struts-bean tag in JSP.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure your <message-resources> tag reads:

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

NOT

<message-resources>ApplicationResources.properties</message-resources>
 
Ravi Seshu
Ranch Hand
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic