Saturday, March 28, 2009

How to configure multiple ApplicationResource.properties properties in Struts application

Considering you have multiple modules in your web application, you would obviously want to separate the resource bundles for each of them.

Steps:
1. Create separate resource bundles for each modules. Name them accordingly as per conventions and place them in the classpath folder.

2. Add following in the Struts-Config.xml file:
message-resources key="applicationResource_1" parameter="com/package/ApplicationResource"/>

3. Now, in a jsp to view the labels and message, you can sue the following tag:
< bundle="applicationResource_1" key="label.1">

Cheers,
-Ibu

0 comments:

Post a Comment