public class AcceptHeaderLocaleResolver extends java.lang.Object implements LocaleResolver
Note: Does not support setLocale, since the accept header
can only be changed through changing the client's locale settings.
ServletRequest.getLocale()| Constructor and Description |
|---|
AcceptHeaderLocaleResolver() |
| Modifier and Type | Method and Description |
|---|---|
java.util.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,
java.util.Locale locale)
Set the current locale to the given one.
|
public java.util.Locale resolveLocale(javax.servlet.http.HttpServletRequest request)
LocaleResolverresolveLocale in interface LocaleResolverrequest - the request to resolve the locale fornull)public void setLocale(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.util.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