History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: WW-1052
Type: Bug Bug
Status: Resolved Resolved
Resolution: Not A Problem
Priority: Major Major
Assignee: Patrick Lightbody
Reporter: Cláudio Fernando Vagheti
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
WebWork

Always cleanup ActionContext

Created: 30/Dec/05 10:39 AM   Updated: 07/Jan/06 03:52 PM
Component/s: Dispatch
Affects Version/s: 2.2
Fix Version/s: 2.2

Flags: Important


 Description  « Hide
in the com.opensymphony.webwork.dispatcher.ActionContextCleanUp atribute is always false.

public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
        try {
            req.setAttribute(CLEANUP_PRESENT, Boolean.TRUE);
            chain.doFilter(req, res);
        } finally {
            req.setAttribute(CLEANUP_PRESENT, Boolean.FALSE); // always executed
            cleanUp(req);
        }
    }

Always cleanup

protected static void cleanUp(ServletRequest req) {
        // should we clean up yet?
        Boolean dontClean = (Boolean) req.getAttribute(CLEANUP_PRESENT);
        if (dontClean != null && dontClean.booleanValue()) {
            return;
        }

 All   Comments   Change History      Sort Order:
tm_jee - [02/Jan/06 02:57 AM ]
Looks like it is working as it should be. Or am i missing somthing?

Patrick Lightbody - [07/Jan/06 03:52 PM ]
This is not a bug... the behavior is correct, though I suppose the variable names are a bit confusing. Notice this line:

Boolean dontClean = (Boolean) req.getAttribute(CLEANUP_PRESENT);
        if (dontClean != null && dontClean.booleanValue()) {
            return;
        }


That means if the value is TRUE, we don't clean up. That's why we set it to false before cleaning up.