wood burning stoves 2.0*
The moose likes Struts and the fly likes  Confirmation reg Properties file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark " Confirmation reg Properties file " Watch " Confirmation reg Properties file " New topic
Author

Confirmation reg Properties file

Ram Adsumalli
Ranch Hand

Joined: Oct 16, 2006
Posts: 64
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

Joined: Feb 15, 2005
Posts: 4864
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" />


Merrill
Consultant, Sima Solutions
Ram Adsumalli
Ranch Hand

Joined: Oct 16, 2006
Posts: 64
Thanks merill
 
wood burning stoves
 
subject: Confirmation reg Properties file