Configuring locales and resource bundles

A properties file that contains messages can be named PlayerMessages.properties. When we have messages in several languages, we can create a properties file for each language and name it accordingly. For example, for English it will be PlayerMessages_en.properties, and for French it will be PlayerMessages_fr.properties. A convenient place to store them is in the application source folder directly or in subfolders (or, in NetBeans, under Other Sources folder in a Maven web application project). A resource bundle is capable of loading and displaying messages from these files.

A resource bundle can be configured locally or globally. A local resource bundle loads the properties file for the specified page only. ...

Get Mastering JavaServer Faces 2.2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.