LocaleResolverpublic class SessionLocaleResolver extends AbstractLocaleResolver
LocaleResolver implementation that
uses a locale attribute in the user's session in case of a custom setting,
with a fallback to the specified default locale or the request's
accept-header locale.
Created: 2016. 3. 13.
| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
LOCALE_SESSION_ATTRIBUTE_NAME |
Name of the session attribute that holds the Locale.
|
static java.lang.String |
TIME_ZONE_SESSION_ATTRIBUTE_NAME |
Name of the session attribute that holds the TimeZone.
|
| Constructor | Description |
|---|---|
SessionLocaleResolver() |
| Modifier and Type | Method | Description |
|---|---|---|
java.util.Locale |
resolveLocale(Translet translet) |
Resolve the current locale via the given translet.
|
java.util.TimeZone |
resolveTimeZone(Translet translet) |
Resolve the current timezone via the given translet.
|
void |
setLocale(Translet translet,
java.util.Locale locale) |
Set the current locale to the given one.
|
void |
setTimeZone(Translet translet,
java.util.TimeZone timeZone) |
Set the current timezone to the given one.
|
getDefaultLocale, getDefaultTimeZone, resolveDefaultLocale, resolveDefaultTimeZone, setDefaultLocale, setDefaultLocale, setDefaultTimeZone, setDefaultTimeZonepublic static final java.lang.String LOCALE_SESSION_ATTRIBUTE_NAME
public static final java.lang.String TIME_ZONE_SESSION_ATTRIBUTE_NAME
public java.util.Locale resolveLocale(Translet translet)
LocaleResolvertranslet - the translet to resolve the locale fornull)public java.util.TimeZone resolveTimeZone(Translet translet)
LocaleResolvertranslet - the translet to resolve the timezone fornull)public void setLocale(Translet translet, java.util.Locale locale)
LocaleResolversetLocale in interface LocaleResolversetLocale in class AbstractLocaleResolvertranslet - the translet to resolve the locale forlocale - the new locale, or null to clear the localepublic void setTimeZone(Translet translet, java.util.TimeZone timeZone)
LocaleResolversetTimeZone in interface LocaleResolversetTimeZone in class AbstractLocaleResolvertranslet - the translet to resolve the locale fortimeZone - the new timezone, or null to clear the timezoneCopyright © 2008–2018 The Aspectran Project. All rights reserved.