You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 31 Next »

The framework supports internationalization (i18n) in two different places: the UI tags and the action/field error messages, including the Validation messages.

Resource Bundle Search Order

Error formatting macro: snippet: java.lang.NullPointerException

For more, see the LocalizedTextUtil class.

Package hierarchy

Error formatting macro: snippet: java.lang.NullPointerException

Examples

There are several ways to access the message resources, including getText, the text tag, and the i18n tag.

Using getText

To display i18n text, use a call to getText in the property tag, or any other tag, such as the UI tags. (The getText technique is especially useful for labels of UI tags.)

Error formatting macro: snippet: java.lang.NullPointerException

Using the text tag

The text tag retrieves a message from the default resource bundle.

Error formatting macro: snippet: java.lang.NullPointerException

Using the I18n tag

The i18n tag pushes an arbitrary resource bundle on to the value stack. Other tags within the scope of the i18n tag can display messages from that resource bundle.

Error formatting macro: snippet: java.lang.NullPointerException

Internationalizing SiteMesh decorators is possible, but there are quirks. See SiteMesh for more.

I18n Interceptor

Essentially, the i18n Interceptor pushes a locale into the ActionContext map upon every request. The framework components that support localization all utilize the ActionContext locale. See I18n Interceptor for details.

Global Resources (action.custom.i18n.resources) in action.properties

Error formatting macro: snippet: java.lang.NullPointerException

Comparison with SAF1

Error formatting macro: snippet: java.lang.NullPointerException
  • No labels