• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts Modules and message resources

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an application that has used <bean:message> for quite some time. I have had multiple struts-config files and each one defined message-resources that it needed. This all worked correctly
I just changed my application to use Struts Modules. I confirmed that I have everything working correctly with tiles and my navigation, but when I use a bean:message tag that references a message-resource definition in one of the module config-files, I get an error stating that
Cannot find message resources under key managementMessages
Where managementMessages is the name of the key in the <message-resources> declaration
The page being rendered is in the same Struts Module that the <message-resource> being requested is defined
Also,
If the <bean:message> tag references a <message-resources> in the default module, then it works correctly
Anyone come across this before? I am ready to ditch modules if I cannot get this working.
Thanks
 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
USe this
<message-resources null="false" parameter="name of properties file"/>
<message-resources key="another name" null="false" parameter="another name"/>
here key name is same as parametere name
for eg
<message-resources null="false" parameter="xyz"/>
<message-resources key="abc" null="false" parameter="abc"/>
xyz.propertis
abc.properties
xyz is the default property file
and inside jsp u use the
for second properties file
<bean:message bundle="abc" key="lable.keyname"/>
for first one ther is no need to specify the bundle = " " (properties file name
hope u can understand this and will help u.
 
Scott Collins
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That didn't seem to do anything.
The only thing that worked was for me to copy the <message-resources>
definition from each module's struts-config file and put it into the struts-config file of the default module. This defeats the purpose of having modules.
Anyone else have any suggestions?
 
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I also have the same question. Please take a look.

https://coderanch.com/t/48236/Struts/Resource-Bundle-files-Modules-setup
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Benson Fung:
I also have the same question. Please take a look.

https://coderanch.com/t/48236/Struts/Resource-Bundle-files-Modules-setup



Is the problem solved now? Because it seems that I have still the same problem: I have an application with several modules.
In one of this module, I define the two following messages resources:
<message-resources key="context" null="false" parameter="blabla.context.ApplicationResources"/>
<message-resources key="menu" null="false" parameter="blabla.authorization.ApplicationResources"/>.

And in my JSP, I have:
<bean:message bundle="context" key="myLocale"/>
=> When I want to display the page, I get the following error: "Cannot find message resources under key context"

However, if I add the module context path, it works:
<bean:message bundle="context/path_to_my_module" key="myLocale"/>

And I don't like the idea to "hardcode" my module path in each <bean:message> bundle property...

Thanks in advance,

J�r�my

[ September 28, 2005: Message edited by: Jeremy Tukif ]
[ September 28, 2005: Message edited by: Jeremy Tukif ]
reply
    Bookmark Topic Watch Topic
  • New Topic