public class AcceptHeaderLocaleResolver extends 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 |
---|---|
Locale |
resolveLocale(HttpServletRequest request)
Resolve the current locale via the given request.
|
void |
setLocale(HttpServletRequest request,
HttpServletResponse response,
Locale locale)
Set the current locale to the given one.
|
public Locale resolveLocale(HttpServletRequest request)
LocaleResolver
resolveLocale
in interface LocaleResolver
request
- the request to resolve the locale fornull
)public void setLocale(HttpServletRequest request, HttpServletResponse response, Locale locale)
LocaleResolver
setLocale
in interface LocaleResolver
request
- 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