public class FixedLocaleResolver extends AbstractLocaleResolver
LocaleResolver implementation
that always returns a fixed default locale. Default is the current
JVM's default locale.
Note: Does not support setLocale, as the fixed locale
cannot be changed.
AbstractLocaleResolver.setDefaultLocale(java.util.Locale)| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
Locale |
resolveLocale(javax.servlet.http.HttpServletRequest request)
Resolve the current locale via the given request.
|
void |
setLocale(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Locale locale)
Set the current locale to the given one.
|
getDefaultLocale, setDefaultLocalepublic FixedLocaleResolver()
public FixedLocaleResolver(Locale locale)
locale - the locale to exposepublic Locale resolveLocale(javax.servlet.http.HttpServletRequest request)
LocaleResolverrequest - the request to resolve the locale fornull)public void setLocale(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Locale locale)
LocaleResolverrequest - the request to be used for locale modificationresponse - the response to be used for locale modificationlocale - the new locale, or null to clear the localeCopyright © 2015. All rights reserved.