[
https://issues.apache.org/struts/browse/WW-1816?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Rainer Hermanns reassigned WW-1816:
-----------------------------------
Assignee: Rainer Hermanns
> FitlerDispatcher not always calling ActionContextCleanUp.cleanUp(Request)
> -------------------------------------------------------------------------
>
> Key: WW-1816
> URL: https://issues.apache.org/struts/browse/WW-1816
> Project: Struts 2
> Issue Type: Bug
> Affects Versions: 2.0.6
> Reporter: Jasper Rosenberg
> Assigned To: Rainer Hermanns
> Fix For: 2.0.8
>
> Attachments: FilterDispatcher.java.patch
>
>
> I ran into a problem while porting from WW to Struts 2 where my multipart
> requests were inconistently getting wrapped by the FilterDispatcher.
> I tracked it down to the fact that
> FilterDispatcher.prepareDispatcherAndWrapRequest() only wraps the request if
> there is not already a thread local dispatcher instance available. (This
> differs from WW where it was always wrapped). As far as I can tell, there
> are two places in doFilter() where the thread local dispatcher instance may
> not be cleaned up properly.
> 1. If dispatcher.sendError() throws an unexpected exception.
> 2. If mapping is null.
> If either of these cases is the last request on a web server thread, then the
> next time a request comes in on that thread the dispatcher instance will
> still be available and the request will not be properly wrapped.
> The fix is simple I believe, which is to simply call
> "ActionContextCleanUp.cleanUp(req);" only in the doFilter() finally block.
> My current workaround is to use the
> org.apache.struts2.dispatcher.ActionContextCleanUp filter in my web.xml
> (before the struts dispatcher filter). This works, but I don't think it
> makes sense to require its use for people not using Sitemesh, etc.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.