Deprecated
since 6.0.
as of 6.0 in favor of using CSS, without direct replacement
ThemeResolver implementation 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.
setThemeName
| Modifier and Type | Field and Description |
|---|---|
| public static final String | DEFAULT_COOKIE_NAME
The default name of the cookie that holds the theme name. |
| private String | |
| public static final String | ORIGINAL_DEFAULT_THEME_NAME
The default theme name used if no alternative is provided. |
| public static final String | THEME_REQUEST_ATTRIBUTE_NAME
Name of the request attribute that holds the theme name. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | |
| public String | resolveThemeName(HttpServletRequest
the request to be used for resolution request)Implements org. Resolve the current theme name via the given request. |
| public void | |
| public void | setThemeName(HttpServletRequest
the request to be used for theme name modification request, HttpServletResponse the response to be used for theme name modification response, String the new theme name ( themeName)null or empty to reset it)Implements org. Set the current theme name to the given one. |
| DEFAULT_COOKIE_NAME | back to summary |
|---|---|
| public static final String DEFAULT_COOKIE_NAME The default name of the cookie that holds the theme name. | |
| defaultThemeName | back to summary |
|---|---|
| private String defaultThemeName | |
| ORIGINAL_DEFAULT_THEME_NAME | back to summary |
|---|---|
| public static final String ORIGINAL_DEFAULT_THEME_NAME The default theme name used if no alternative is provided. | |
| THEME_REQUEST_ATTRIBUTE_NAME | back to summary |
|---|---|
| public static final String THEME_REQUEST_ATTRIBUTE_NAME 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. | |
| CookieThemeResolver | back to summary |
|---|---|
| public CookieThemeResolver() | |
| getDefaultThemeName | back to summary |
|---|---|
| public String getDefaultThemeName() Return the name of the default theme. | |
| resolveThemeName | back to summary |
|---|---|
| public String resolveThemeName(HttpServletRequest request) Implements org. Doc from org. Resolve the current theme name via the given request. Should return a default theme as fallback in any case.
| |
| setDefaultThemeName | back to summary |
|---|---|
| public void setDefaultThemeName(String defaultThemeName) Set the name of the default theme. | |
| setThemeName | back to summary |
|---|---|
| public void setThemeName(HttpServletRequest request, HttpServletResponse response, String themeName) Implements org. Doc from org. Set the current theme name to the given one.
| |