public class

SessionThemeResolver

extends AbstractThemeResolver
java.lang.Object
   ↳ org.springframework.web.servlet.theme.AbstractThemeResolver
     ↳ org.springframework.web.servlet.theme.SessionThemeResolver

Class Overview

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

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

Summary

[Expand]
Inherited Constants
From class org.springframework.web.servlet.theme.AbstractThemeResolver
Fields
public static final String THEME_SESSION_ATTRIBUTE_NAME Name of the session attribute that holds the theme name.
Public Constructors
SessionThemeResolver()
Public Methods
String resolveThemeName(HttpServletRequest request)
void setThemeName(HttpServletRequest request, HttpServletResponse response, String themeName)
[Expand]
Inherited Methods
From class org.springframework.web.servlet.theme.AbstractThemeResolver
From class java.lang.Object
From interface org.springframework.web.servlet.ThemeResolver

Fields

public static final String THEME_SESSION_ATTRIBUTE_NAME

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

Public Constructors

public SessionThemeResolver ()

Public Methods

public String resolveThemeName (HttpServletRequest request)

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