java.lang.Object | ||
↳ | org.springframework.web.util.CookieGenerator | |
↳ | 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 default theme. This is particularly useful for stateless applications without user sessions.
Custom controllers can thus override the user's theme by calling
setThemeName
, e.g. responding to a certain theme change request.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | ORIGINAL_DEFAULT_THEME_NAME |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.web.util.CookieGenerator
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DEFAULT_COOKIE_NAME | |||||||||||
THEME_REQUEST_ATTRIBUTE_NAME | Name of the request attribute that holds the theme name. |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.web.util.CookieGenerator
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return the name of the default theme.
| |||||||||||
Resolve the current theme name via the given request.
| |||||||||||
Set the name of the default theme.
| |||||||||||
Set the current theme name to the given one.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.web.util.CookieGenerator
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.web.servlet.ThemeResolver
|
Name of the request attribute that holds the theme name. Only used for overriding a cookie value if the theme has been changed in the course of the current request! Use RequestContext.getTheme() to retrieve the current theme in controllers or views.
Resolve the current theme name via the given request. Should return a default theme as fallback in any case.
request | request to be used for resolution |
---|
Set the current theme name to the given one.
request | request to be used for theme name modification |
---|---|
response | response to be used for theme name modification |
themeName | the new theme name |