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.
setDefaultLocale, setDefaultTimeZone
| Access | Constructor and Description |
|---|---|
| public | FixedLocaleResolver()
Create a default FixedLocaleResolver, exposing a configured default locale (or the JVM's default locale as fallback). |
| public | FixedLocaleResolver(Locale
the locale to expose locale)Create a FixedLocaleResolver that exposes the given locale. |
| public | FixedLocaleResolver(Locale
the locale to expose locale, TimeZone the time zone to expose timeZone)Create a FixedLocaleResolver that exposes the given locale and time zone. |
| Modifier and Type | Method and Description |
|---|---|
| public Locale | resolveLocale(HttpServletRequest
the request to resolve the locale for request)Overrides default org. Implements org. Default implementation of |
| public LocaleContext | resolveLocaleContext(HttpServletRequest
the request to resolve the locale context for request)Implements org. Resolve the current locale context via the given request. |
| public void | setLocaleContext(HttpServletRequest
the request to be used for locale modification request, HttpServletResponse the response to be used for locale modification response, LocaleContext the new locale context, or localeContext)null to clear the localeImplements org. Set the current locale context to the given one, potentially including a locale with associated time zone information. |
| FixedLocaleResolver | back to summary |
|---|---|
| public FixedLocaleResolver() Create a default FixedLocaleResolver, exposing a configured default locale (or the JVM's default locale as fallback).
| |
| FixedLocaleResolver | back to summary |
|---|---|
| public FixedLocaleResolver(Locale locale) Create a FixedLocaleResolver that exposes the given locale.
| |
| FixedLocaleResolver | back to summary |
|---|---|
| public FixedLocaleResolver(Locale locale, TimeZone timeZone) Create a FixedLocaleResolver that exposes the given locale and time zone. | |
| resolveLocale | back to summary |
|---|---|
| public Locale resolveLocale(HttpServletRequest request) Overrides default org. Implements org. Doc from org. Default implementation of
| |
| resolveLocaleContext | back to summary |
|---|---|
| public LocaleContext resolveLocaleContext(HttpServletRequest request) Implements org. Doc from org. Resolve the current locale context via the given request. This is primarily intended for framework-level processing; consider using
The returned context may be a
Custom resolver implementations may also return extra settings in the returned context, which again can be accessed through downcasting.
| |
| setLocaleContext | back to summary |
|---|---|
| public void setLocaleContext(HttpServletRequest request, HttpServletResponse response, LocaleContext localeContext) Implements org. Doc from org. Set the current locale context to the given one, potentially including a locale with associated time zone information.
| |