Home

This Chapter
-Chapter 11: Message Handling and Internationalization
-Working with Locales in Struts
-Registering Properties Files
-The HTML Tag Librarys’s errors Tag
-The HTML Librarys’s messages Tag
-JSTL I18N Library
-Summary

Table of Contents
-Introduction
-Chapter 1: Model 2 and Struts
-Chapter 2: Input Validation with Action Forms
-Chapter 3: The HTML Tag Library
-Chapter 4: Input Validation and Data Conversion
-Chapter 5: The Validator Plugin
-Chapter 6: The Expression Language
-Chapter 7: JSTL
-Chapter 8: The Bean Tag Library
-Chapter 9: The Logic Tag Library
-Chapter 10: Struts-EL, Nested, selectLabel
-Chapter 11: Message Handling and Internationalization
-Chapter 12: The Tiles Framework
-Chapter 13: Securing Struts Applications
-Chapter 14: The Config Object
-Chapter 15: The Persistence Layer
-Chapter 16: Object Caching
-Chapter 17: File Upload and File Download
-Chapter 18: Paging and Sorting
-Chapter 19: Preventing Double Submits
-Chapter 20: Early HttpSession Invalidation
-Chapter 21: Decorating Request Objects
-Chapter 22: How Struts Works

Previous
Next

 

Chapter 11

Message Handling and Internationalization

Message handling is an important task in application development. For example, it is almost always required that an application is able to display error messages that are easy to understand. Also, nowadays it is often a requirement that an application be able to “speak” many languages. A technique for developing applications that support multiple languages and data formats without having to rewrite the programming logic is called internationalization. Internationalization is abbreviated i18n because the word starts with an i and ends with an n, and there are 18 characters between the first i and the last n. In addition, localization is the technique of adapting an internationalized application to support a specific locale. A locale is a specific geographical, political, or cultural region. An operation that takes a locale into consideration is said to be locale-sensitive. For example, displaying a date is locale-sensitive because the date must be in the format used by the country or region of the user. The 15th day of November 2005 is written as 11/15/2005 in the US, but written as 15/11/2005 in Australia. Localization is abbreviated l10n because the word starts with an l and ends with an n and there are 10 letters between the l and the n.

With internationalization, you can change the visual text in an application quickly and easily. Java has built-in supports for this feature that enables an application to change language without the need for recompilation.

Struts makes use of this feature and was designed to support internationalization from the beginning. For example, the message tag in the Struts Bean Tag Library is capable of selecting a message in the correct language. However, since it is a recommendation to use JSTL instead of Struts’ tag libraries, I will also discuss the internationalization-related tags in JSTL.

Previous
Next