The moose likes JSF and the fly likes Resource bundle in Prime faces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Resource bundle in Prime faces" Watch "Resource bundle in Prime faces" New topic

Resource bundle in Prime faces

Mary Cole
Ranch Hand

Joined: Dec 02, 2000
Posts: 362
I have the resource.properties file under WEB-INF/classes folder and the faces-config.xml looks like this

Al accessing the value in an output text

resource.properties entry is

But when I access the xhtml, the value is blank. Am I missing anything here?

Thanks in advance

Cesar Loachamin
Ranch Hand

Joined: Dec 25, 2010
Posts: 90

Hi Mary.

You're a little confused as you say you want to use a resource bundle so you must use a <resource-bundle>, so if you have a properties file named resource.properties you must put it in a package for example com.testpackage, and you can configure the resource bundle in the faces-config so,

And by doing this, you can use the resource (resource is the name that you give to resource-bundle using the <var> tag) as you want:


When a dream is ending because to come true - OCPJP 6,7. OCE JPA EE6. MCTS
Mary Cole
Ranch Hand

Joined: Dec 02, 2000
Posts: 362
Thanks , it worked
I agree. Here's the link: http://aspose.com/file-tools
subject: Resource bundle in Prime faces