spring-framework / org.springframework.web.servlet.i18n / FixedLocaleResolver

FixedLocaleResolver

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 setLocale(Context), as the fixed locale and time zone cannot be changed.

Author
Juergen Hoeller

Since
1.1

See Also
#setDefaultLocale#setDefaultTimeZone

Constructors

<init>

FixedLocaleResolver()

Create a default FixedLocaleResolver, exposing a configured default locale (or the JVM's default locale as fallback).

FixedLocaleResolver(locale: Locale)

Create a FixedLocaleResolver that exposes the given locale.

FixedLocaleResolver(locale: Locale, timeZone: TimeZone)

Create a FixedLocaleResolver that exposes the given locale and time zone.

Functions

resolveLocale

open fun resolveLocale(request: HttpServletRequest): Locale

resolveLocaleContext

open fun resolveLocaleContext(request: HttpServletRequest): LocaleContext

setLocaleContext

open fun setLocaleContext(request: HttpServletRequest, response: HttpServletResponse, localeContext: LocaleContext): Unit

Inherited Functions

getDefaultTimeZone

open fun getDefaultTimeZone(): TimeZone

Return the default TimeZone that this resolver is supposed to fall back to, if any.

setDefaultTimeZone

open fun setDefaultTimeZone(defaultTimeZone: TimeZone): Unit

Set a default TimeZone that this resolver will return if no other time zone found.

setLocale

open fun setLocale(request: HttpServletRequest, response: HttpServletResponse, locale: Locale): Unit