Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.struts2.dispatcher
Class ActionContextCleanUp

    java.lang.Object
      org.apache.struts2.dispatcher.ActionContextCleanUp

All Implemented Interfaces:
  Filter

    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:

- this filter
- SiteMesh filter
- `FilterDispatcher`

Version:
  $Date: 2006-12-08 14:57:59 -0500 (Fri, 08 Dec 2006) $ $Id: ActionContextCleanUp.java 484717 2006-12-08 19:57:59Z mrdon $
See Also:
  `FilterDispatcher`, `AbstractFilter`, `Dispatcher`

Field Summary
`private static String` | `COUNTER`
`private static Log` | `LOG`

Constructor Summary
`ActionContextCleanUp()`

Method Summary
`protected static void` | `cleanUp(ServletRequest req)` Clean up the request of threadlocals if this is the last execution
`void` | `destroy()`
`void` | `doFilter(ServletRequest req, ServletResponse res, FilterChain chain)`
`void` | `init(FilterConfig arg0)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### LOG

    private static final Log LOG

### COUNTER

    private static final String COUNTER

See Also:
  Constant Field Values

Constructor Detail

### ActionContextCleanUp

    public ActionContextCleanUp()

Method Detail

### doFilter

    public void doFilter(ServletRequest req,
                         ServletResponse res,
                         FilterChain chain)
                  throws IOException,
                         ServletException

  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)

  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 `Filter`

### init

    public void init(FilterConfig arg0)
              throws ServletException

  Specified by:
    `init` in interface `Filter`
  Throws:
    `ServletException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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