Supporting multiple languages for labels or help text in a PageHandler

When you are developing a JSP file for use with a PageHandler, you can specify literal text for labels, as well as for the hover-help text that is displayed when the user places the cursor over an input field. When you are developing the PageHandler itself, you can set the default values for that literal text by setting the primitive field-level properties displayName and help for a given field.

When you customize the JSP file, however, you can identify a Java™ resource bundle or properties file that provides text at run time. The process is as follows:
  1. Create the resource bundle or properties file.
  2. Add a JSF loadBundle tag to the Web page:
      <f:loadBundle baseName=fileName var=variableName>
    fileName
    Name of the resource bundle or properties file, not including the locale
    variableName
    Name of the variable to be used in other JSF tags in the Web page.

    An example is as follows:

      <f:loadBundle baseName="Resources" var="labels"/> 
  3. To access the resource bundle, reference the variable in an output field, whether for a label or help text::
      <h:output_text value="#{variableName.key}"
    variableName
    Name of a variable, as specified in a loadBundle tag.
    key
    The key for the message in the resource bundle.
    An example is as follows:
      <h:output_text value="#{labels.label1}"

To identify the resource bundle or properties file used for runtime messages, set the PageHandler part property msgResource.

Related concepts
PageHandler
Related reference
displayName
help
PageHandler part properties

Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.