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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.