org.springframework.web.servlet.theme
Class SessionThemeResolver

org.springframework.web.servlet.theme.AbstractThemeResolver
  |
  +--org.springframework.web.servlet.theme.SessionThemeResolver

public class SessionThemeResolver
extends AbstractThemeResolver

Implementation of ThemeResolver that uses a theme attribute in the user's session in case of a custom setting, with a fallback to the fixed default theme. This is most appropriate if the application needs user sessions anyway.

Custom controllers can override the user's theme by calling setTheme, e.g. responding to a theme change request.

Author:
Jean-Pierre Pawlak, Juergen Hoeller
Since: 17.06.2003

Field Summary
 final static StringTHEME_SESSION_ATTRIBUTE_NAME
          Name of the session attribute that holds the theme name.

Fields inherited from class org.springframework.web.servlet.theme.AbstractThemeResolver
ORIGINAL_DEFAULT_THEME_NAME

Method Summary
 StringresolveThemeName(HttpServletRequest request)
           
 voidsetThemeName(HttpServletRequest request, HttpServletResponse response, String themeName)
           

Methods inherited from class org.springframework.web.servlet.theme.AbstractThemeResolver
getDefaultThemeName, makeThemeNameAvailable, setDefaultThemeName

Field Detail

THEME_SESSION_ATTRIBUTE_NAME

public final static String THEME_SESSION_ATTRIBUTE_NAME
Name of the session attribute that holds the theme name. Only used internally by this implementation. Use RequestContext.getTheme() to retrieve the current theme in controllers or views.
See Also:
org.springframework.web.servlet.support.RequestContext.getTheme()
Method Detail

resolveThemeName

public String resolveThemeName(HttpServletRequest request)

setThemeName

public void setThemeName(HttpServletRequest request, HttpServletResponse response, String themeName)

Association Links

to Class java.lang.String

Name of the session attribute that holds the theme name. Only used internally by this implementation. Use RequestContext.getTheme() to retrieve the current theme in controllers or views.

see org.springframework.web.servlet.support.RequestContext#getTheme