user1494328
user1494328

Reputation: 681

Where to put properties files in a JSF application and how to load it with f:loadBundle tag?

I tried to add properties files to my xhtml page in JSF by using f:loadBundle tag. I tried do it many times in different ways but nothing works (prop_files/logowanie, prop_files.logowanie). I kept property files in WebContent/prop_files folder and xhtml files are in WebContent.

Please help me how to add properties to page. Maybe I keep this files in wrong folder?

Upvotes: 1

Views: 1454

Answers (1)

Ravi Kadaboina
Ravi Kadaboina

Reputation: 8574

The basename of a f:loadBundle tag should be like a class name as the properties files is loaded by the class loader like this:

 <f:loadBundle basename="com.examples.messages" var="msgs"/>

The file extension should be .properties.

So place the file in your classpath for example in your src/java/com/examples/messages.properties

Upvotes: 1

Related Questions