Class CookieThemeResolver
java.lang.Object
org.springframework.web.util.CookieGenerator
org.springframework.web.servlet.theme.CookieThemeResolver
- All Implemented Interfaces:
- ThemeResolver
@Deprecated(since="6.0")
public class CookieThemeResolver
extends CookieGenerator
implements ThemeResolver
Deprecated.
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.
- Since:
- 17.06.2003
- Author:
- Jean-Pierre Pawlak, Juergen Hoeller
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.The default name of the cookie that holds the theme name.static final StringDeprecated.The default theme name used if no alternative is provided.static final StringDeprecated.Name of the request attribute that holds the theme name.Fields inherited from class org.springframework.web.util.CookieGeneratorDEFAULT_COOKIE_PATH, logger
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionDeprecated.Return the name of the default theme.resolveThemeName(HttpServletRequest request) Deprecated.Resolve the current theme name via the given request.voidsetDefaultThemeName(String defaultThemeName) Deprecated.Set the name of the default theme.voidsetThemeName(HttpServletRequest request, HttpServletResponse response, String themeName) Deprecated.Set the current theme name to the given one.Methods inherited from class org.springframework.web.util.CookieGeneratoraddCookie, createCookie, getCookieDomain, getCookieMaxAge, getCookieName, getCookiePath, isCookieHttpOnly, isCookieSecure, removeCookie, setCookieDomain, setCookieHttpOnly, setCookieMaxAge, setCookieName, setCookiePath, setCookieSecure
- 
Field Details- 
ORIGINAL_DEFAULT_THEME_NAMEDeprecated.The default theme name used if no alternative is provided.- See Also:
 
- 
THEME_REQUEST_ATTRIBUTE_NAMEDeprecated.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_NAMEDeprecated.The default name of the cookie that holds the theme name.
 
- 
- 
Constructor Details- 
CookieThemeResolverpublic CookieThemeResolver()Deprecated.
 
- 
- 
Method Details- 
setDefaultThemeNameDeprecated.Set the name of the default theme.
- 
getDefaultThemeNameDeprecated.Return the name of the default theme.
- 
resolveThemeNameDeprecated.Description copied from interface:ThemeResolverResolve the current theme name via the given request. Should return a default theme as fallback in any case.- Specified by:
- resolveThemeNamein interface- ThemeResolver
- Parameters:
- request- the request to be used for resolution
- Returns:
- the current theme name
 
- 
setThemeNamepublic void setThemeName(HttpServletRequest request, @Nullable HttpServletResponse response, @Nullable String themeName) Deprecated.Description copied from interface:ThemeResolverSet the current theme name to the given one.- Specified by:
- setThemeNamein interface- ThemeResolver
- Parameters:
- request- the request to be used for theme name modification
- response- the response to be used for theme name modification
- themeName- the new theme name (- nullor empty to reset it)
 
 
-