O'Reilly logo

Special Edition Using Java™ 2 Enterprise Edition by Mark Wutka

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Resource Bundles

The Java's i18n support includes objects known as resource bundles. When you create a multilingual application or Web site, you don't always want to make separate screens or pages for each language. For example, when you create an HTML form, the prompt strings can be in different languages, but the HTML for defining the form itself is the same no matter what language you use.

By using resource bundles, you can group various prompt strings and other objects that are locale-dependent. When you create a resource bundle class, you decide on a base classname and then define each locale's resources in a class whose name is formed by adding the locale to the end of the classname.

For example, you might store some resources in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required