• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Priti Shah
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Works fine for me. Although my syntax is a bit different:

 
Priti Shah
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!