Class CookieThemeResolver
java.lang.Object
org.springframework.web.util.CookieGenerator
org.springframework.web.servlet.theme.CookieThemeResolver
- All Implemented Interfaces:
ThemeResolver
@Deprecated(since="6.0",
forRemoval=true)
public class CookieThemeResolver
extends CookieGenerator
implements ThemeResolver
Deprecated, for removal: This API element is subject to removal in a future version.
as of 6.0 in favor of using CSS, without direct replacement for removal in 7.1
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
, for example, responding to a certain theme change request.
- Since:
- 17.06.2003
- Author:
- Jean-Pierre Pawlak, Juergen Hoeller
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Deprecated, for removal: This API element is subject to removal in a future version.The default name of the cookie that holds the theme name.static final String
Deprecated, for removal: This API element is subject to removal in a future version.The default theme name used if no alternative is provided.static final String
Deprecated, for removal: This API element is subject to removal in a future version.Name of the request attribute that holds the theme name.Fields inherited from class org.springframework.web.util.CookieGenerator
DEFAULT_COOKIE_PATH, logger
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated, for removal: This API element is subject to removal in a future version.Return the name of the default theme.resolveThemeName
(HttpServletRequest request) Deprecated, for removal: This API element is subject to removal in a future version.Resolve the current theme name via the given request.void
setDefaultThemeName
(String defaultThemeName) Deprecated, for removal: This API element is subject to removal in a future version.Set the name of the default theme.void
setThemeName
(HttpServletRequest request, @Nullable HttpServletResponse response, @Nullable String themeName) Deprecated, for removal: This API element is subject to removal in a future version.Set the current theme name to the given one.Methods inherited from class org.springframework.web.util.CookieGenerator
addCookie, createCookie, getCookieDomain, getCookieMaxAge, getCookieName, getCookiePath, isCookieHttpOnly, isCookieSecure, removeCookie, setCookieDomain, setCookieHttpOnly, setCookieMaxAge, setCookieName, setCookiePath, setCookieSecure
-
Field Details
-
ORIGINAL_DEFAULT_THEME_NAME
Deprecated, for removal: This API element is subject to removal in a future version.The default theme name used if no alternative is provided.- See Also:
-
THEME_REQUEST_ATTRIBUTE_NAME
Deprecated, for removal: This API element is subject to removal in a future version.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.- See Also:
-
DEFAULT_COOKIE_NAME
Deprecated, for removal: This API element is subject to removal in a future version.The default name of the cookie that holds the theme name.
-
-
Constructor Details
-
CookieThemeResolver
public CookieThemeResolver()Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
setDefaultThemeName
Deprecated, for removal: This API element is subject to removal in a future version.Set the name of the default theme. -
getDefaultThemeName
Deprecated, for removal: This API element is subject to removal in a future version.Return the name of the default theme. -
resolveThemeName
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:ThemeResolver
Resolve the current theme name via the given request. Should return a default theme as fallback in any case.- Specified by:
resolveThemeName
in interfaceThemeResolver
- Parameters:
request
- the request to be used for resolution- Returns:
- the current theme name
-
setThemeName
public void setThemeName(HttpServletRequest request, @Nullable HttpServletResponse response, @Nullable String themeName) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:ThemeResolver
Set the current theme name to the given one.- Specified by:
setThemeName
in interfaceThemeResolver
- Parameters:
request
- the request to be used for theme name modificationresponse
- the response to be used for theme name modificationthemeName
- the new theme name (null
or empty to reset it)
-