Integrating Custom I18N Actions

The default locale, resource bundle, and time zone for the JSTL I18N actions can be specified through four configuration settings, described in Tables Table 22-1 through Table 22-4.

Table 22-1. Locale configuration setting

Variable name:

javax.servlet.jsp.jstl.fmt.locale

Java constant:

Config.FMT_LOCALE

Java type:

String or java.util.Locale

Set by:

<fmt:setLocale>, context parameter, or custom code

Used by:

<fmt:bundle>, <fmt:setBundle>, <fmt:message>, <fmt:formatNumber>, <fmt:parseNumber>, <fmt:formatDate>, and <fmt:parseDate>

Table 22-2. Fallback locale configuration setting

Variable name:

javax.servlet.jsp.jstl.fmt.fallbackLocale

Java constant:

Config.FMT_FALLBACK_LOCALE

Java type:

String or java.util.Locale

Setby:

Context parameter or custom code

Used by:

<fmt:bundle>, <fmt:setBundle>, <fmt:message>, <fmt:formatNumber>, <fmt:parseNumber>, <fmt:formatDate>, and <fmt:parseDate>

Table 22-3. Localization context configuration setting

Variable name:

javax.servlet.jsp.jstl.fmt.localizationContext

Java constant:

Config.FMT_LOCALIZATION_CONTEXT

Java type:

String or javax.servlet.jsp.jstl.fmt.LocalizationContext

Set by:

<fmt:setBundle>, context parameter, or custom code

Used by:

<fmt:message>, <fmt:formatNumber>, <fmt:parseNumber>, <fmt:formatDate>, and <fmt:parseDate>

Table 22-4. Time zone configuration setting

Variable name:

javax.servlet.jsp.jstl.fmt.timeZone

Java constant:

Config.FMT_TIME_ZONE

Get JavaServer Pages, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.