Skip to Main Content
Jakarta Struts Cookbook
book

Jakarta Struts Cookbook

by Bill Siggelkow
February 2005
Intermediate to advanced content levelIntermediate to advanced
528 pages
12h 53m
English
O'Reilly Media, Inc.
Content preview from Jakarta Struts Cookbook

Chapter 12. Internationalization

Introduction

Struts has long been known as a good framework for constructing applications that can be used across multiple languages and geographies. The basis for Struts internationalization (i18n) support is Java. Java's features for internationalization and localization are quite mature, having been around since Java 1.1. At the heart of Struts i18n support is the java.util.Locale object. This object is used throughout Struts to identify a client user's language and country.

You can use Struts to adapt an application to a specific locale using the following features:

  • MessageResources bundles (e.g., properties files) that provide localized messages, prompts, and data formats

  • Creation of locales based on the user's browser settings

  • Formatting of dates and numbers using locale-specific patterns

  • Retrieval of locale-specific images

  • Ability to specify an appropriate HTTP response character-encoding

Like Struts, JSTL provides tags for localizing data. The JSTL tags are, in many cases, more robust and easier to use than the Struts tags. Thankfully, you don't have to choose one or the other (see Recipe 12.2). The recipes in this chapter give you options for using Struts or JSTL where appropriate.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming Jakarta Struts

Programming Jakarta Struts

Chuck Cavaness
Beginning Spring Framework 2

Beginning Spring Framework 2

Bruce Snyder, Sing Li, Anne Horton, Thomas Van de Velde, Naveen Balani, Christian Dupuis
Java Cookbook

Java Cookbook

Ian F. Darwin
Struts 2 in Action

Struts 2 in Action

J. Scott Stanlick, Chad Michael Davis, Donald J. Brown

Publisher Resources

ISBN: 059600771XSupplemental ContentErrata Page