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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark " Confirmation reg Properties file " Watch " Confirmation reg Properties file " New topic

Confirmation reg Properties file

Ram Adsumalli
Ranch Hand

Joined: Oct 16, 2006
Posts: 64

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" />

Consultant, Sima Solutions
Ram Adsumalli
Ranch Hand

Joined: Oct 16, 2006
Posts: 64
Thanks merill
I agree. Here's the link: http://aspose.com/file-tools
subject: Confirmation reg Properties file
Similar Threads
Printing details from the jsp page using struts
Help with Struts using WSAD
language propertis to xml properties
Missing message for key "welcome.title" in bundle "(default bundle)" for locale en_US
request.getParameter access the Struts form values