abstract class AbstractLocaleContextResolver : AbstractLocaleResolver, LocaleContextResolver
Abstract base class for LocaleContextResolver implementations. Provides support for a default locale and a default time zone.
Also provides pre-implemented versions of #resolveLocale and #setLocale, delegating to #resolveLocaleContext and #setLocaleContext.
Author
Juergen Hoeller
Since
4.0
See Also
#setDefaultLocale#setDefaultTimeZone
AbstractLocaleContextResolver()
Abstract base class for LocaleContextResolver implementations. Provides support for a default locale and a default time zone. Also provides pre-implemented versions of |
open fun getDefaultTimeZone(): TimeZone
Return the default TimeZone that this resolver is supposed to fall back to, if any. |
|
open fun resolveLocale(request: HttpServletRequest): Locale |
|
open fun setDefaultTimeZone(defaultTimeZone: TimeZone): Unit
Set a default TimeZone that this resolver will return if no other time zone found. |
|
open fun setLocale(request: HttpServletRequest, response: HttpServletResponse, locale: Locale): Unit |
open fun setDefaultLocale(defaultLocale: Locale): Unit
Set a default Locale that this resolver will return if no other locale found. |
open class FixedLocaleResolver : AbstractLocaleContextResolver
org.springframework.web.servlet.LocaleResolver implementation that always returns a fixed default locale and optionally time zone. Default is the current JVM's default locale. Note: Does not support |
|
open class SessionLocaleResolver : AbstractLocaleContextResolver
org.springframework.web.servlet.LocaleResolver implementation that uses a locale attribute in the user's session in case of a custom setting, with a fallback to the specified default locale or the request's accept-header locale. This is most appropriate if the application needs user sessions anyway, i.e. when the Custom controllers can override the user's locale and time zone by calling In contrast to CookieLocaleResolver, this strategy stores locally chosen locale settings in the Servlet container's Note that there is no direct relationship with external session management mechanisms such as the "Spring Session" project. This |