mikehalfsheen
asked on
Using two (or more) resource files in struts
I've a struts app that uses an ApplicicationResources.pro perties file as a message-resource. I'd like ( well the powers that be would like :-( ) to split the file in two so that the customer can edit certain elements within the file. How do I get Struts to use two - message-resources ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Struts has built in support for internationalization (I18N). You can define one or more <message-resources> elements for your webapp; modules can define their own resource bundles. Different bundles can be used simultaneously in your application, the 'key' attribute is used to specify the desired bundle.
className - Classname of configuration bean. [org.apache.struts.config.
factory - Classname of MessageResourcesFactory. [org.apache.struts.util.Pr
key - ServletContext attribute key to store this bundle. [org.apache.struts.action.
null - Set to false to display missing resource keys in your application like '???keyname???' instead of null. [true] (optional)
parameter - Name of the resource bundle. (required)
Example configuration:
<message-resources
parameter="MyWebAppResourc
null="false" />
This would set up a message resource bundle provided in the file MyWebAppResources.properti