Documentation
JSFToolbox

Search 

Contents

  1. Introduction
  2. Getting Started
  3. Developing Web Sites
  4. Using Components
  5. Internationalization
  6. Code View Support
  7. Design View Support
  8. Keyboard Shortcuts
  9. Tag Object Toolbars
  10. JSF Server Behaviors
  11. Property Inspectors
Selected 12. JSF Tag Reference

12. JSF Tag Reference

Contents > JSF Tag Reference > JSF Core Tags

10. JSF Core Tag Reference

Contents > JSF Core Tag Reference > f:loadBundle

f:loadBundle

The LoadBundle tag loads a resource bundle for the Locale of the current view and stores it as a Map in request scope. This tag is useful for internationalization (I18N) as it allows you to access your message bundle in your JSF page.. The body content of this tag must be empty.

      

Place this tag above any other component tags on your document (in the head section, for instance) and specify a variable name for the bundle. You can then use value-binding expressions to output localized content on your page.

      

Note: It is possible, but not recommended, to define resource bundle keys in a properties file that use a dot notation, such as

      
message.welcome=Welcome to our site!

Athough this is syntax is legal for a Java resource bundle, it is not valid for a JSF message bundle due to expression language parsing. For JSF, the above message should be defined as follows:

welcomeMessage=Welcome to our site!

Example:

<f:loadBundle basename="com.mycompany.MessageBundle" var="bundle" />
<h:outputText value="#{bundle.welcomeMessage}" />

HTML Output

Welcome to our site!

Tag Attributes

basename String
Required
The basename attribute identifies the base name of the resource bundle to be loaded. JSFToolbox will detect any available message bundles when it scans your site.
var String
Required
The var attribute sets the name of a request scope attribute under which the resource bundle will be exposed as a Map. You can use value-binding expressions to output message bundle properties in your JSF tags.