First page Back Continue Last page Graphics

Resource Bundles


Notes:

Resource Bundles

Resource bundles contain the actual text that you have added to the application. You need to create a version of the resource bundle for each locale where your application will be used, and add a <locale-config> element to define default and support locales in the application’s faces-config.xml file. You also need to add a <resource-bundle> element to your application’s faces-config.xml file to make the resource bundles available to all the pages in your application without using a <f:loadBundle> tag in every page. (With JSF1.2, you don’t need to load the base resource bundle on each page of your application with the <f:loadBundle> tag).

After you have configured and registered a resource bundle, the Expression Language editor will display the key from the bundle, making it easier to reference the bundle in application pages.

The first example in the slide shows part of the UIResources.properties file, which displays some of the English-language entries for static text in the StoreFront application. The second example shows the same file named UIResources_de.properties, but with the browser set to use the German language.