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 withCookieSiteResolver
when you want to set up simple multi tenancy.- Author:
- avasquez
-
-
Field Summary
Fields Modifier and Type Field Description protected String
cookieDomain
protected int
cookieMaxAge
protected String
cookieName
protected String
cookiePath
protected boolean
enabled
protected boolean
httpOnly
protected boolean
secure
-
Constructor Summary
Constructors Constructor Description SiteCookieChangeInterceptor(boolean enabled, String cookieName, String cookieDomain, String cookiePath, int cookieMaxAge, boolean httpOnly, boolean secure)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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
-
-
-
-
Constructor Detail
-
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 Detail
-
postHandle
public void postHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler, org.springframework.web.servlet.ModelAndView modelAndView)
-
-