[Enterprise Extensions only]

Programming examples

This section illustrates usage of the Internationalization context API within various Enterprise JavaBean application components.

To use the Internationalization Service, all application components must import types supplied in the com.ibm.websphere.i18n.context package. A component gains access to the service by performing a JNDI lookup on the initial context for URL java:comp/websphere/UserInternationalization to resolve a reference to the UserInternationalization interface. It can then use this reference to obtain references to either the Internationalization or InvocationInternationalization interfaces, depending on whether the component requires access to caller, or to invocation Internationalization context, respectively. These steps are collectively referred to as "resolving the Internationalization context API" within the examples.

Differences in and suggestions for service utilization among the various application components are discussed in comments preceding relevant statement blocks.

For details, see the following examples: