Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Confirmation reg Properties file

 
Ram Adsumalli
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

If we got two properties file in the struts application. and you configure in struts-config.xml. Then if you are using these properties file in jsp page . then how the jsp page will know from which properties file it had take the label.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you set up two Message Resource bundles in struts-config.xml, you must specify a key attribute with at least one of them. The one without the key attribute will be considered the default bundle. When you want to use the non-default bundle, you must specify a bundle attribute in the tag.

Example. In your struts-config.xml file:

<message-resources parameter="com.mycompany.ApplicationResources"/>

<message-resources key="moreResources" parameter="com.mycompany.MoreApplicationResources"/>

in your JSP:

this tag will use ApplicationResources:

<bean:message key="mykey" />

This tag will use MoreApplicationResources:

<bean:message bundle="moreResources" key="mykey" />
 
Ram Adsumalli
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks merill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic