[jetty-dev] [jira] (JETTY-1545) HttpServletResponseWrapper ignored when using asyncContext and redispatching

"Bartosz Kowalewski (JIRA)" <[email protected]> Tue, 18 Sep 2012 10:28:21 -0500 (CDT)
Newsgroups gmane.comp.java.jetty.general
Message-ID <1334935657.58416.1347982101323.JavaMail.j2ee-jira@codehaus01.managed.contegix.com>
Bartosz Kowalewski
created JETTY-1545

HttpServletResponseWrapper ignored when using asyncContext and redispatching

Issue Type:

Bug

Affects Versions:

8.1.5

Assignee:

Unassigned

Created:

18/Sep/12 10:27 AM

Description:

This is closely related with JETTY-1504 . That JIRA has been fixed. The

'protected void suspend(final ServletContext context, final ServletRequest request, final ServletResponse response)' method of AsyncContinuation now sets the _responseWrapped flag. However, after the message is redispatched - after I call start async and dispatch on the async context, and the exchange is routed back to my servlet - the flag is cleared and when I call getServletResponse() on AsyncContinuation I get unwrapped response.

This is because when the exchange is redispatched and is being prepared to be passed to the servlet AbstractHttpConnection.handleRequest() calls AsyncContinuation.handling() which sets the _responseWrapped flag to false.

Is this an expected behavior or a bug?

Please note that CXF uses the same pattern as we do:

{

suspend

spawn

{ resume }

}

dispatch

{ write }

However, after the exchange is redispatched, CXF doesn't use the provided (potentially unwrapped) servlet response, but uses the one that was passed to the servlet when the exchnage entered it for the first time. CXF attaches the response to its own continuation object and this continuation is attached to the servlet request, so the continutaion (and the attached reponse wrapper) is not lost when redispatching.

Environment:

8.1.5 & 8.1.7

Project:

Jetty

Priority:

Major

Reporter:

Bartosz Kowalewski

This message is automatically generated by JIRA.

If you think it was sent incorrectly, please contact your JIRA administrators .

For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email