public final class SessionHandler extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CURRENT_USER_LOCALE
Attribute for the current user locale.
|
Modifier and Type | Method and Description |
---|---|
void |
currentUserLocaleChanged(javax.servlet.http.HttpServletRequest request)
Method to be called to notify the session handler that the user changed his profile language.
|
Locale |
getCurrentLocale(javax.servlet.http.HttpServletRequest request)
Get the current locale.
|
static SessionHandler |
instance()
The one and only instance
|
void |
overrideCurrentUserLocale(javax.servlet.http.HttpServletRequest request,
Locale locale)
Stores the locale in the session to override the locale of the current user.
|
boolean |
overrideCurrentUserLocaleIfNotOverridden(javax.servlet.http.HttpServletRequest request,
Locale locale)
Stores the locale in the session to override the locale of the current user.
|
void |
resetOverriddenCurrentUserLocale(javax.servlet.http.HttpServletRequest request)
Remove the locale from the session if it was set with a call to
overrideCurrentUserLocale(HttpServletRequest, Locale) |
public static final String CURRENT_USER_LOCALE
public static SessionHandler instance()
public void currentUserLocaleChanged(javax.servlet.http.HttpServletRequest request)
request
- the current requestpublic Locale getCurrentLocale(javax.servlet.http.HttpServletRequest request)
request
- the current request to usepublic void overrideCurrentUserLocale(javax.servlet.http.HttpServletRequest request, Locale locale)
request
- the current requestlocale
- the locale to set, if null
resetOverriddenCurrentUserLocale(HttpServletRequest)
will be calledpublic boolean overrideCurrentUserLocaleIfNotOverridden(javax.servlet.http.HttpServletRequest request, Locale locale)
request
- the current requestlocale
- the locale to setpublic void resetOverriddenCurrentUserLocale(javax.servlet.http.HttpServletRequest request)
overrideCurrentUserLocale(HttpServletRequest, Locale)
request
- The current requestCopyright © 2019 Communote team. All rights reserved.