org.apache.struts2.dispatcher
Class ActionContextCleanUp

java.lang.Object
  extended by org.apache.struts2.dispatcher.ActionContextCleanUp
All Implemented Interfaces:
Filter

Deprecated. Since Struts 2.1.3, use StrutsPrepareFilter and StrutsExecuteFilter to use other Servlet filters that need access to the ActionContext

public class ActionContextCleanUp
extends Object
implements 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 data 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:

Version:
$Date: 2008-07-07 14:10:42 +0000 (Mon, 07 Jul 2008) $ $Id: ActionContextCleanUp.java 674498 2008-07-07 14:10:42Z mrdon $
See Also:
FilterDispatcher, Dispatcher, StrutsPrepareFilter, StrutsExecuteFilter

Field Summary
private static String COUNTER
          Deprecated.  
private static Logger LOG
          Deprecated.  
 
Constructor Summary
ActionContextCleanUp()
          Deprecated.  
 
Method Summary
protected static void cleanUp(ServletRequest req)
          Deprecated. Clean up the request of threadlocals if this is the last execution
 void destroy()
          Deprecated.  
 void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
          Deprecated.  
 void init(FilterConfig arg0)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Logger LOG
Deprecated. 

COUNTER

private static final String COUNTER
Deprecated. 
See Also:
Constant Field Values
Constructor Detail

ActionContextCleanUp

public ActionContextCleanUp()
Deprecated. 
Method Detail

doFilter

public void doFilter(ServletRequest req,
                     ServletResponse res,
                     FilterChain chain)
              throws IOException,
                     ServletException
Deprecated. 
Specified by:
doFilter in interface Filter
Throws:
IOException
ServletException
See Also:
Filter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)

cleanUp

protected static void cleanUp(ServletRequest req)
Deprecated. 
Clean up the request of threadlocals if this is the last execution

Parameters:
req - The servlet request

destroy

public void destroy()
Deprecated. 
Specified by:
destroy in interface Filter

init

public void init(FilterConfig arg0)
          throws ServletException
Deprecated. 
Specified by:
init in interface Filter
Throws:
ServletException


Copyright © 2000-2009 Apache Software Foundation. All Rights Reserved.