jQuery in Action, 2nd edition*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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
 
 
subject: Confirmation reg Properties file
 
Similar Threads
Missing message for key "welcome.title" in bundle "(default bundle)" for locale en_US
Help with Struts using WSAD
request.getParameter access the Struts form values
Printing details from the jsp page using struts
language propertis to xml properties