public abstract class AbstractLocaleContextResolver extends AbstractLocaleResolver implements LocaleContextResolver
LocaleContextResolver implementations.
Provides support for a default locale and a default time zone.
Also provides pre-implemented versions of resolveLocale(javax.servlet.http.HttpServletRequest) and setLocale(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.util.Locale),
delegating to LocaleContextResolver.resolveLocaleContext(javax.servlet.http.HttpServletRequest) and LocaleContextResolver.setLocaleContext(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.springframework.context.i18n.LocaleContext).
AbstractLocaleResolver.setDefaultLocale(java.util.Locale),
setDefaultTimeZone(java.util.TimeZone)| Constructor and Description |
|---|
AbstractLocaleContextResolver() |
| Modifier and Type | Method and Description |
|---|---|
TimeZone |
getDefaultTimeZone()
Return the default TimeZone that this resolver is supposed to fall back to, if any.
|
Locale |
resolveLocale(HttpServletRequest request)
Resolve the current locale via the given request.
|
void |
setDefaultTimeZone(TimeZone defaultTimeZone)
Set a default TimeZone that this resolver will return if no other time zone found.
|
void |
setLocale(HttpServletRequest request,
HttpServletResponse response,
Locale locale)
Set the current locale to the given one.
|
getDefaultLocale, setDefaultLocaleclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitresolveLocaleContext, setLocaleContextpublic void setDefaultTimeZone(@Nullable TimeZone defaultTimeZone)
@Nullable public TimeZone getDefaultTimeZone()
public Locale resolveLocale(HttpServletRequest request)
LocaleResolverresolveLocale in interface LocaleResolverrequest - the request to resolve the locale fornull)public void setLocale(HttpServletRequest request, @Nullable HttpServletResponse response, @Nullable Locale locale)
LocaleResolversetLocale in interface 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 locale