Two Laptop Bag
The moose likes JSF and the fly likes How to declare multiple message bundles in Faces-config.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "How to declare multiple message bundles in Faces-config.xml" Watch "How to declare multiple message bundles in Faces-config.xml" New topic
Author

How to declare multiple message bundles in Faces-config.xml

Priti Shah
Ranch Hand

Joined: May 10, 2005
Posts: 43
Hi

I have different properties file which I want to use as message bundle.

Message.properties
Help.properties

When I specify this in faces-config.xml
<application>
<message-bundle>/Message</message-bundle>
<message-bundle>/Help</message-bundle>
</application>

and now when I try to use that in my jsp page like this

<f:loadBundle basename="/Message" var="message"/>
<f:loadBundle basename="/Help" var="help"/>

and access any messagestring from those files I can not excess either of them. But when I use only one of them it works fine.

Am I doing something wrong or I can not do this thing at all??

Thanks in advance.
Gregg Bolinger
Ranch Hand

Joined: Jul 11, 2001
Posts: 15229

Works fine for me. Although my syntax is a bit different:

Priti Shah
Ranch Hand

Joined: May 10, 2005
Posts: 43
Hi greg,

Thanks for the quick reply.
It is working for me but i found that problem is in my custom component.

In my jsp I am using these bundles like this
<f:loadBundle basename="/Message" var="message"/>
<f:loadBundle basename="/Help" var="help"/>


Now in my custom component I am getting ResourceBundle from the current context and it is returning me 'help' but my messagekey is in 'message' bundle.

Any suggestions how can I do this.

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to declare multiple message bundles in Faces-config.xml
 
Similar Threads
JSF 2 - Internationalization - Message Resources
Internationalized messages in javascript
Resourcebundle can not be found!
JSF message in faces-config.xml itself
how to customize error messages