org.springframework.web.servlet.i18n

Class AbstractLocaleContextResolver

    • Constructor Detail

      • AbstractLocaleContextResolver

        public AbstractLocaleContextResolver()
    • Method Detail

      • setDefaultTimeZone

        public void setDefaultTimeZone(@Nullable
                                       java.util.TimeZone defaultTimeZone)
        Set a default TimeZone that this resolver will return if no other time zone found.
      • getDefaultTimeZone

        @Nullable
        public java.util.TimeZone getDefaultTimeZone()
        Return the default TimeZone that this resolver is supposed to fall back to, if any.
      • resolveLocale

        public java.util.Locale resolveLocale(HttpServletRequest request)
        Description copied from interface: LocaleResolver
        Resolve the current locale via the given request. Can return a default locale as fallback in any case.
        Specified by:
        resolveLocale in interface LocaleResolver
        Parameters:
        request - the request to resolve the locale for
        Returns:
        the current locale (never null)
      • setLocale

        public void setLocale(HttpServletRequest request,
                              @Nullable
                              HttpServletResponse response,
                              @Nullable
                              java.util.Locale locale)
        Description copied from interface: LocaleResolver
        Set the current locale to the given one.
        Specified by:
        setLocale in interface LocaleResolver
        Parameters:
        request - the request to be used for locale modification
        response - the response to be used for locale modification
        locale - the new locale, or null to clear the locale