|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.web.filter.GenericFilterBean
org.springframework.web.filter.OncePerRequestFilter
com.ervacon.springframework.web.servlet.mvc.webflow.WebFlowCleanupFilter
Servlet 2.3 filter that cleans up expired web flows in the HTTP session associated with the request being filtered. A flow has expired when it has not handled any requests for more that a specified timeout period.
This filter can be configured in the web.xml deployment descriptor of your web application. Here's an example:
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> <filter> <filter-name>webFlowCleanup</filter-name> <filter-class>com.ervacon.springframework.web.servlet.mvc.webflow.WebFlowCleanupFilter</filter-class> </filter> <filter-mapping> <filter-name>webFlowCleanup</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> ...
Exposed configuration properties:
| name | default | description |
| timeout | 10 | Specifies the flow timeout in minutes. If the flow is inactive for more that this period of time it will expire and be removed from the HTTP session. |
| Field Summary | |
static int |
DEFAULT_TIMEOUT
Default web flow timout: 10 minutes. |
| Fields inherited from class org.springframework.web.filter.OncePerRequestFilter |
ALREADY_FILTERED_SUFFIX |
| Fields inherited from class org.springframework.web.filter.GenericFilterBean |
logger |
| Constructor Summary | |
WebFlowCleanupFilter()
|
|
| Method Summary | |
protected void |
doCleanup(javax.servlet.http.HttpServletRequest request)
Remove expired flows from the HTTP session associated with given request. |
protected void |
doFilterInternal(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain filterChain)
|
int |
getTimeout()
Get the flow timout (expiry), expressed in minutes. |
protected boolean |
hasExpired(javax.servlet.http.HttpServletRequest request,
WebFlowMementoStack mementos)
Check if given web flow memento stack, found in the session associated with given request, has expired. |
void |
setTimeout(int timeout)
Set the flow timout (expiry), expressed in minutes. |
| Methods inherited from class org.springframework.web.filter.OncePerRequestFilter |
doFilter, getAlreadyFilteredAttributeName, shouldNotFilter |
| Methods inherited from class org.springframework.web.filter.GenericFilterBean |
addRequiredProperty, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setFilterConfig |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int DEFAULT_TIMEOUT
Default web flow timout: 10 minutes.
| Constructor Detail |
public WebFlowCleanupFilter()
| Method Detail |
public int getTimeout()
Get the flow timout (expiry), expressed in minutes.
public void setTimeout(int timeout)
Set the flow timout (expiry), expressed in minutes.
protected void doFilterInternal(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain filterChain)
throws javax.servlet.ServletException,
java.io.IOException
javax.servlet.ServletException
java.io.IOExceptionprotected void doCleanup(javax.servlet.http.HttpServletRequest request)
Remove expired flows from the HTTP session associated with given request.
protected boolean hasExpired(javax.servlet.http.HttpServletRequest request,
WebFlowMementoStack mementos)
Check if given web flow memento stack, found in the session associated with given request, has expired.
Subclasses can override this method if they want to change the expiry logic, e.g. to keep flows alive in certain situations.
request - current HTTP requestmementos - the web flow memento stack that needs to be checked for expiry
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||