@Override public void setThemeName( HttpServletRequest request, @Nullable HttpServletResponse response, @Nullable String themeName) { Assert.notNull(response, "HttpServletResponse is required for CookieThemeResolver"); if (StringUtils.hasText(themeName)) { // Set request attribute and add cookie. request.setAttribute(THEME_REQUEST_ATTRIBUTE_NAME, themeName); addCookie(response, themeName); } else { // Set request attribute to fallback theme and remove cookie. request.setAttribute(THEME_REQUEST_ATTRIBUTE_NAME, getDefaultThemeName()); removeCookie(response); } }
@Override public void setThemeName( HttpServletRequest request, @Nullable HttpServletResponse response, @Nullable String themeName) { Assert.notNull(response, "HttpServletResponse is required for CookieThemeResolver"); if (StringUtils.hasText(themeName)) { // Set request attribute and add cookie. request.setAttribute(THEME_REQUEST_ATTRIBUTE_NAME, themeName); addCookie(response, themeName); } else { // Set request attribute to fallback theme and remove cookie. request.setAttribute(THEME_REQUEST_ATTRIBUTE_NAME, getDefaultThemeName()); removeCookie(response); } }
@Override public void setThemeName(HttpServletRequest request, HttpServletResponse response, String themeName) { if (StringUtils.hasText(themeName)) { // Set request attribute and add cookie. request.setAttribute(THEME_REQUEST_ATTRIBUTE_NAME, themeName); addCookie(response, themeName); } else { // Set request attribute to fallback theme and remove cookie. request.setAttribute(THEME_REQUEST_ATTRIBUTE_NAME, getDefaultThemeName()); removeCookie(response); } }