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

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

JIRA jira@codehaus.org
Issue Type: Bug 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 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
Reply | Threaded
Open this post in threaded view
|

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

JIRA jira@codehaus.org

I can also confirm experiencing this issue. If the request and response are both wrapped, followed by request.startAsync(wrappedRequest, wrappedResponse), followed by asyncContext.dispatch(), after the dispatch the request is still wrapped, the response is not.

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
Reply | Threaded
Open this post in threaded view
|

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

JIRA jira@codehaus.org
In reply to this post by JIRA jira@codehaus.org

This issue really belongs to Eclipse Bugzilla as Jetty versions higher or equal to 7 are hosted there. That's why I reported the same problem @Eclipse: https://bugs.eclipse.org/bugs/show_bug.cgi?id=390661.

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