public class ConcurrentSessionFilter extends Object implements javax.servlet.Filter, org.springframework.beans.factory.InitializingBean
This filter performs two functions. First, it calls
SessionRegistry.refreshLastRequest(String) for each request. That way,
registered sessions always have a correct "last update" date/time. Second, it retrieves SessionInformation from the SessionRegistry for each request and checks
if the session has been marked as expired. If it has been marked as expired, the session is invalidated. The
invalidation of the session will also cause the request to redirect to the URL specified, and a HttpSessionDestroyedEvent to be published via the HttpSessionEventPublisher registered in web.xml.
| Constructor and Description |
|---|
ConcurrentSessionFilter() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
void |
destroy()
Does nothing.
|
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain) |
void |
init(javax.servlet.FilterConfig arg0)
Does nothing.
|
void |
setExpiredUrl(String expiredUrl) |
void |
setSessionRegistry(SessionRegistry sessionRegistry) |
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionpublic void destroy()
destroy in interface javax.servlet.Filterpublic void doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
throws IOException,
javax.servlet.ServletException
doFilter in interface javax.servlet.FilterIOExceptionjavax.servlet.ServletExceptionpublic void init(javax.servlet.FilterConfig arg0)
throws javax.servlet.ServletException
init in interface javax.servlet.Filterarg0 - ignoredjavax.servlet.ServletException - ignoredpublic void setExpiredUrl(String expiredUrl)
public void setSessionRegistry(SessionRegistry sessionRegistry)
Copyright © 2016. All rights reserved.