Class 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 Detail

      • enabled

        protected boolean enabled
      • cookieName

        protected String cookieName
      • cookieDomain

        protected String cookieDomain
      • cookiePath

        protected String cookiePath
      • cookieMaxAge

        protected int cookieMaxAge
      • httpOnly

        protected boolean httpOnly
      • secure

        protected boolean secure
    • 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)