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.InitializingBean
Exception
public void destroy()
destroy
in interface javax.servlet.Filter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
doFilter
in interface javax.servlet.Filter
IOException
javax.servlet.ServletException
public void init(javax.servlet.FilterConfig arg0) throws javax.servlet.ServletException
init
in interface javax.servlet.Filter
arg0
- ignoredjavax.servlet.ServletException
- ignoredpublic void setExpiredUrl(String expiredUrl)
public void setSessionRegistry(SessionRegistry sessionRegistry)
Copyright © 2004–2019 Interface21, Inc. All rights reserved.