|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.web.servlet.theme.AbstractThemeResolver org.springframework.web.servlet.theme.CookieThemeResolver
Implementation of ThemeResolver that uses a cookie sent back to the user in case of a custom setting, with a fallback to the fixed locale. This is especially useful for stateless applications without user sessions.
Custom controllers can thus override the user's theme by calling setTheme, e.g. responding to a certain theme change request.
Field Summary | |
static int |
DEFAULT_COOKIE_MAX_AGE
|
static java.lang.String |
DEFAULT_COOKIE_NAME
|
static java.lang.String |
DEFAULT_COOKIE_PATH
|
static java.lang.String |
THEME_REQUEST_ATTRIBUTE_NAME
Name of the request attribute that holds the theme name. |
Fields inherited from class org.springframework.web.servlet.theme.AbstractThemeResolver |
ORIGINAL_DEFAULT_THEME_NAME |
Constructor Summary | |
CookieThemeResolver()
|
Method Summary | |
int |
getCookieMaxAge()
|
java.lang.String |
getCookieName()
|
java.lang.String |
getCookiePath()
Use the given path for theme cookies. |
java.lang.String |
resolveThemeName(javax.servlet.http.HttpServletRequest request)
Resolve the current theme name via the given request. |
void |
setCookieMaxAge(int cookieMaxAge)
Use the given maximum age, specified in seconds, for locale cookies. |
void |
setCookieName(java.lang.String cookieName)
Use the given name for theme cookies, containing the theme name. |
void |
setCookiePath(java.lang.String cookiePath)
|
void |
setThemeName(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String themeName)
Set the current theme name to the given one. |
Methods inherited from class org.springframework.web.servlet.theme.AbstractThemeResolver |
getDefaultThemeName, makeThemeNameAvailable, setDefaultThemeName |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String THEME_REQUEST_ATTRIBUTE_NAME
RequestContext.getTheme()
public static final java.lang.String DEFAULT_COOKIE_NAME
public static final java.lang.String DEFAULT_COOKIE_PATH
public static final int DEFAULT_COOKIE_MAX_AGE
Constructor Detail |
public CookieThemeResolver()
Method Detail |
public void setCookieName(java.lang.String cookieName)
public java.lang.String getCookieName()
public java.lang.String getCookiePath()
public void setCookiePath(java.lang.String cookiePath)
public void setCookieMaxAge(int cookieMaxAge)
public int getCookieMaxAge()
public java.lang.String resolveThemeName(javax.servlet.http.HttpServletRequest request)
ThemeResolver
request
- request to be used for resolution
public void setThemeName(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String themeName)
ThemeResolver
request
- request to be used for theme name modificationresponse
- response to be used for theme name modificationthemeName
- the new theme name
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |