Use resource bundles in store pages

A new programming direction has been undertaken with our starter stores that now use the JavaServer Pages Standard Tag Library (JSTL) to perform view logic, instead of Java code.


Task info

This changes the way we use resource bundles with store pages. At run time, each requested JSP includes the JSTLEnvironmentSetup.jspf file. This file retrieves and prepares the JSP page path, file path, and resource bundle, which are used by other JSP pages. This file is called by many JSP files in the store. The command context and locale are retrieved as shown:

The locale is used to retrieve appropriate locale specific ResourceBundle (properties file) through a call to the sdb.getResourceBundle as shown in the following example:

Dynamic data is retrieved at runtime using various server bean methods and is performed in the context of the current language. The returned value for the language parameter (language_ID) determines the language in which the store name displays. The displayName method of the StoreDataBean retrieves this value. The following example shows the request for the language-specific store display name:

The locale and language are retrieved at runtime to determine the correct folder in which to look for the image file.

For example, the template may look for the file ConsumerDirect/ lang_country/images/colors/color1/go_button.gif, where lang_country is the language_region part of the locale retrieved from the command context. The resulting page will display the image: ConsumerDirect/en_US/images/colors/color1/go_button.gif ConsumerDirect/ja_JP/images/colors/color1/go_button.gif


Related concepts
WebSphere Commerce configuration file (wc-server.xml)
Outbound messaging system
Globalized catalog content
Cultural considerations
Localized store assets
Globalization in the messaging system
Programming models for globalized stores
Globalized store design
Supporting globalization
Globalized tools framework
WebSphere Commerce useBean tag


Related tasks
Creating a globalized store
Creating a new display format
Creating and using resource bundles in the tools framework
Setting the dir attribute for bidi specifications


Related reference
Globalization tips