Class SiteCookieChangeInterceptor
java.lang.Object
org.springframework.web.servlet.handler.HandlerInterceptorAdapter
org.craftercms.engine.servlet.interceptor.SiteCookieChangeInterceptor
- All Implemented Interfaces:
org.springframework.web.servlet.AsyncHandlerInterceptor
,org.springframework.web.servlet.HandlerInterceptor
public class SiteCookieChangeInterceptor
extends org.springframework.web.servlet.handler.HandlerInterceptorAdapter
Handler interceptor that will set the site cookie whenever the cookie is missing or the current site is different
that the cookie value. Use in conjunction with
CookieSiteResolver
when you want to set up simple multi tenancy.- Author:
- avasquez
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSiteCookieChangeInterceptor
(boolean enabled, String cookieName, String cookieDomain, String cookiePath, int cookieMaxAge, boolean httpOnly, boolean secure) -
Method Summary
Modifier and TypeMethodDescriptionvoid
postHandle
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler, org.springframework.web.servlet.ModelAndView modelAndView) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.web.servlet.AsyncHandlerInterceptor
afterConcurrentHandlingStarted
Methods inherited from interface org.springframework.web.servlet.HandlerInterceptor
afterCompletion, preHandle
-
Field Details
-
enabled
protected boolean enabled -
cookieName
-
cookieDomain
-
cookiePath
-
cookieMaxAge
protected int cookieMaxAge -
httpOnly
protected boolean httpOnly -
secure
protected boolean secure
-
-
Constructor Details
-
SiteCookieChangeInterceptor
@ConstructorProperties({"enabled","cookieName","cookieDomain","cookiePath","cookieMaxAge","httpOnly","secure"}) public SiteCookieChangeInterceptor(boolean enabled, String cookieName, String cookieDomain, String cookiePath, int cookieMaxAge, boolean httpOnly, boolean secure)
-
-
Method Details
-
postHandle
public void postHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler, org.springframework.web.servlet.ModelAndView modelAndView)
-