• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Message Resource

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Make sure you included struts-bean tag in JSP.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
reply
    Bookmark Topic Watch Topic
  • New Topic