Configure container internationalization for servlets
This task configures container internationalization for a servlet within a Web module.
This topic assumes that we have an assembly tool such as Rational Application Developer.
For information about assembly, refer to the documentation for the assembly tool. The steps in this topic refer to Rational Application Developer.
This topic assumes that we have started the assembly tool, configured the assembly tool for work on JEE modules, and created or imported a dynamic Web project.
We must also have set the internationalization type of one or more servlets in a Web project to Container.
This procedure relates one or more servlets to a container-managed internationalization attribute.
- In the Java EE perspective, open the Web project for which to configure container internationalization.
The Web Deployment Descriptor panel is displayed.
- Double-click Dynamic Web Projects.
- Double-click the name of the Web project to see its contents.
- Double-click the deployment descriptor object.
- In the Web Deployment Descriptor panel, click the Servlets tab.
- Scroll down to WebSphere Programming Model Extensions and then Internationalization.
- Following Container-managed Internationalization Attribute, set the Run As field by selecting Caller, Server, or Specified.
- If the servlet is to be run as Specified, select an internationalization policy from the Specified list or define a new policy.
- To define an internationalization policy, click New. The New Specified Initialization wizard is displayed.
- In the Description field, give the policy a name.
- If needed, set a time zone ID and add a time zone description. If we do not find the appropriate time zone in the ID list, click Customize to define one relative to Greenwich Mean Time (GMT).
- Create at least one locale for the policy. To create a locale, click Add; select a language and (Optional) geographic region; specify a variant as needed. Add a locale description and click OK to finish. The new locale is added to the Locales list.
- If more than one locale is defined for the policy, select a locale from the Locales list and click Finish. Otherwise, just click Finish
- From the menu bar, click File > Save.
Results
Selected servlets are now configured to run under the associated internationalization settings.
Related concepts
Container internationalization attributes
Related tasks
Set the internationalization type for servlets