• 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

One more message-resources in struts-config.xml

 
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello,

Can I have multiple entries of message-resources in struts-config.xml?

I am using Jboss 4.0.4 GA.

Rgds,

Seetesh
 
Seetesh Hindlekar
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

struts-config.xml
<message-resources parameter="application" />
<message-resources parameter="MessageResources" />

on declaring sample.seet in application.properties file I get the following error

javax.servlet.ServletException: Missing message for key "sample.seet"

rgds,

Seetesh
 
Seetesh Hindlekar
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello

I tried the following but getting same Exception

"Cannot find message resources under key MessageResources"


<h3><bean:message bundle="MessageResources" key="welcome.heading"/></h3>
<p><bean:message bundle="MessageResources" key="welcome.message"/></p>

<h3><bean:message bundle="application" key="app.seet"/></h3>
<p><bean:message bundle="application" key="app2.seet"/></p>


Rgds,

Seetesh
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you define multiple message resource bundles, you must assign a key to all but one. The one you don't assign a key to will be the default bundle. example:

<message-resources parameter="application" key="application"/>
<message-resources parameter="MessageResources" />

If I want to use a message key in MessageResources.properties, since it's the default, I don't have to specify a bundle in <bean:message> and the following will work:

<bean:message key="my.key" />

But if I want to use a message key in application.properties, I must specify a bundle like this:

<bean:message bundle="application" key="other.key" />

This link is a very good reference on message resources in Struts.
 
Seetesh Hindlekar
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes Merrill, this link is very useful.

I was referring to this link too.

www.laliluna.de/struts-message-resources-tutorial.html

Rgds,

Seetesh
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic