struts-config:
The first thing you need to do is to define the resource bundles in your struts-config.xml file. The typical struts-config file contains a line that defines the default resource bundle:
To add an additional bundle we need to assign it a key as well as a parameter like so:
Our complete struts-config now contains the following lines:
<message-resources key="registration" parameter="resources.registration"/>
Properties Files:
Create the property files in the /WEB-INF/classes/resources directory with a .properties extention. Now you can add the properties your application will use in each file:
application.properties
site.title=Site Title
registration.properties
username=Your Username
JSP:
Now you can use the properties from either the default bundle or the registration bundle by specifying the bundle (from the key in the struts-config).
You can add more resource bundles by defining them in the struts-config file with a unique key.