org.apache.struts2.dispatcher
Class ActionContextCleanUp
java.lang.Object
org.apache.struts2.dispatcher.ActionContextCleanUp
- All Implemented Interfaces:
- javax.servlet.Filter
public class ActionContextCleanUp
- extends java.lang.Object
- implements javax.servlet.Filter
Special filter designed to work with the FilterDispatcher
and allow
for easier integration with SiteMesh. Normally, ordering your filters to have
SiteMesh go first, and then FilterDispatcher
go second is perfectly fine.
However, sometimes you may wish to access Struts features, including the
value stack, from within your SiteMesh decorators. Because FilterDispatcher
cleans up the ActionContext
, your decorator won't have access to the
date you want.
By adding this filter, the FilterDispatcher
will know to not clean up and
instead defer cleanup to this filter. The ordering of the filters should then be:
- See Also:
FilterDispatcher
Method Summary |
protected static void |
cleanUp(javax.servlet.ServletRequest req)
Clean up the request of threadlocals if this is the last execution |
void |
destroy()
|
void |
doFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
javax.servlet.FilterChain chain)
|
void |
init(javax.servlet.FilterConfig filterConfig)
Initializes the filter |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
filterConfig
protected javax.servlet.FilterConfig filterConfig
dispatcher
protected Dispatcher dispatcher
ActionContextCleanUp
public ActionContextCleanUp()
init
public void init(javax.servlet.FilterConfig filterConfig)
throws javax.servlet.ServletException
- Initializes the filter
- Specified by:
init
in interface javax.servlet.Filter
- Parameters:
filterConfig
- The filter configuration
- Throws:
javax.servlet.ServletException
doFilter
public void doFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
javax.servlet.FilterChain chain)
throws java.io.IOException,
javax.servlet.ServletException
- Specified by:
doFilter
in interface javax.servlet.Filter
- Throws:
java.io.IOException
javax.servlet.ServletException
cleanUp
protected static void cleanUp(javax.servlet.ServletRequest req)
- Clean up the request of threadlocals if this is the last execution
- Parameters:
req
- The servlet request
destroy
public void destroy()
- Specified by:
destroy
in interface javax.servlet.Filter
Copyright © 2000-2006 Apache Software Foundation. All Rights Reserved.