javax.servlet.jsp.jstl.fmt

Class LocalizationContext


  • public class LocalizationContext
    extends Object
    Class representing an I18N localization context.

    An I18N localization context has two components: a resource bundle and the locale that led to the resource bundle match.

    The resource bundle component is used by <fmt:message> for mapping message keys to localized messages, and the locale component is used by the <fmt:message>, <fmt:formatNumber>, <fmt:parseNumber>, <fmt:formatDate>, and <fmt:parseDate> actions as their formatting or parsing locale, respectively.

    Author:
    Jan Luehe
    • Constructor Detail

      • LocalizationContext

        public LocalizationContext()
        Constructs an empty I18N localization context.
      • LocalizationContext

        public LocalizationContext(ResourceBundle bundle,
                                   Locale locale)
        Constructs an I18N localization context from the given resource bundle and locale.

        The specified locale is the application- or browser-based preferred locale that led to the resource bundle match.

        Parameters:
        bundle - The localization context's resource bundle
        locale - The localization context's locale
      • LocalizationContext

        public LocalizationContext(ResourceBundle bundle)
        Constructs an I18N localization context from the given resource bundle.

        The localization context's locale is taken from the given resource bundle.

        Parameters:
        bundle - The resource bundle
    • Method Detail

      • getResourceBundle

        public ResourceBundle getResourceBundle()
        Gets the resource bundle of this I18N localization context.
        Returns:
        The resource bundle of this I18N localization context, or null if this I18N localization context is empty
      • getLocale

        public Locale getLocale()
        Gets the locale of this I18N localization context.
        Returns:
        The locale of this I18N localization context, or null if this I18N localization context is empty, or its resource bundle is a (locale-less) root resource bundle.

Document created the 11/06/2005, last modified the 18/08/2025
Source of the printed document:https://www.gaudry.be/en/java-api-javaee-rf-javax/servlet/jsp/jstl/fmt/localizationcontext.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.

References

  1. View the html document Language of the document:fr Manuel PHP : https://docs.oracle.com/en/java/, Class LocalizationContext

These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author of this site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.