Class AbstractLocaleContextResolver

java.lang.Object
org.springframework.web.servlet.i18n.AbstractLocaleResolver
org.springframework.web.servlet.i18n.AbstractLocaleContextResolver
All Implemented Interfaces:
LocaleContextResolver, LocaleResolver
Direct Known Subclasses:
FixedLocaleResolver, SessionLocaleResolver

public abstract class AbstractLocaleContextResolver extends AbstractLocaleResolver implements LocaleContextResolver
Since:
4.0
Author:
Juergen Hoeller
See Also:
  • Constructor Details

    • AbstractLocaleContextResolver

      public AbstractLocaleContextResolver()
  • Method Details

    • setDefaultTimeZone

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

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

      public 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 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