Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using Multiple Properties Files in Struts Framework

843838Jan 24 2006 — edited Jun 10 2008
Hi Everybody!

I just to know how to use a multiple message-resources files in a Struts Framework.
I've 2 properties file :
 1. ApplicationResources_A.properties
 2. ApplicationResources_B.properties
I put the files under WEB-INF/classes dir.

My configuration in struts-config file something like below:
...
...
 <!--  Begin Testing -->
     <message-resources key="A" parameter="ApplicationResources_A" />
     <message-resources key="B" parameter="ApplicationResources_B" />
 <!--  End Testing -->

</struts-config>

if my JSP code is like below , this error is thrown:
org.apache.jasper.JasperException: Cannot find message resources under key A
...
...
  <tr> 
    <td width="17%">Language A</td>
    <td width="83%"><bean:message bundle="A" key="user.lang.desc"/></td>
  </tr>
  <tr> 
    <td width="17%">Language B</td>
    <td width="83%"><bean:message bundle="B"  key="user.lang.desc"/></td>
  </tr>
..
..

but  if I change the  JSP code like below it  work fine:
  <tr> 
    <td width="17%">Language A</td>
    <td width="83%"><bean:message key="user.lang.desc"/></td>
  </tr>
  <tr> 
    <td width="17%">Language B</td>
    <td width="83%"><bean:message  key="user.lang.desc"/></td>
  </tr>

In this code , I dont know  which resources file is used.
So how do I solve this problem. Thanks you.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 8 2008
Added on Jan 24 2006
5 comments
229 views