Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

multiple message resource file for multiple struts-config.xml

 
shah rah
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have struts-config-module1.xml and struts-config-module2.xml .

I created a message resource file inside struts-config-module1.xml
<message-resources parameter="module1" key="com.mycompany.struts.module1"/>

I have the file module1.properties under com.mycompany.struts. I also have
my application.properties(default) under the same directory.

Inside my jsp file I say

<bean:message bundle = "module1" key = "module1.Name" /> it does not work


if I provide a value for module1.Name inside my application.properties file...it works.

How do I tell my jsp file to look for the new message resource file and not the default one?
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks as though you've got the message-resources attributes reversed. Try:

and it should work.
[ February 06, 2007: Message edited by: Merrill Higginson ]
 
shah rah
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<message-resources
key="LoginMsg"
null="false"
parameter="com.mycompany.struts.LoginMsgResources" />

<bean:message bundle = "LoginMsg" key = "Login.loginname"/>

my LoginMsgResources.properties is under com.mycompany.struts and has Login.loginname=Enter Login

It did not work... I get this when I preview ???Login.loginname???

appreciate your help.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your code looks good. I know this technique works, as I've used it many times before. Just check to make sure that the file exists in web-inf/classes/com/mycompany/struts and that the message key exists in the properties file. Also, make sure you restart the server after making any changes in the struts-config.xml file.
 
shah rah
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
appreciate your help. restarting the server made it work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic