struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Van Riper, Mike" <mvanri...@verisign.com>
Subject RE: Multiple ApplicationResource Properties file with Struts
Date Thu, 05 Sep 2002 17:46:52 GMT

> -----Original Message-----
> From: Declan O'Shanahan (CAPE)
> [mailto:declan.oshanahan@capetechnologies.com]
> Sent: Thursday, September 05, 2002 4:31 AM
> To: struts-user@jakarta.apache.org
> Subject: Multiple ApplicationResource Properties file with Struts
> 
> 
> Hi there,
> 
> I have searched the list for information on multiple message resources
> properties files with Struts1-1b2. I have looked at the dtd for the
> struts-config.xml
> (http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd) 
> and it says
> that there can be multiple message-resources elements. Yet 
> when I include a
> second message-resources element in the struts-config.xml the 
> application
> does not recognoise the new values.
> 
> Does struts1.1b2 support multiple message resources 
> properties files? Any
> hints or help on this would be appreciated.

Yes. I'm using multiple resource properties files with 1.1b2. You must
specify a "key" attribute in all but your default message-resources
elements. In order to pull messages from non-default properties files, you
have to specify this key attribute of the message-resources element as the
"bundle" attribute of the <bean:message> tags you are using in your JSP
pages. If you have this in your struts-config file:

  <message-resources parameter="MyResources" key="MY_RESOURCES_KEY"/>

You would insert messages from the specified properties file like this:

  <bean:message bundle="MY_RESOURCES_KEY" key="prompt.contact.name"/>

At least, this is how I am doing it and it is working for me. Struts does
the lookup in your default properties file when no "bundle" attribute is
specified in your <bean:message> tag.

> 
> Regards,
> 
> Declan O'Shanahan
> 

Cheers,
  Mike Van Riper

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message