https://issues.apache.org/bugzilla/show_bug.cgi?id=53627

          Priority: P2
            Bug ID: 53627
          Assignee: dev@tomcat.apache.org
           Summary: Content-Type header not written after dispatch via
                    AsyncContext
          Severity: normal
    Classification: Unclassified
                OS: Linux
          Reporter: rstoyanc...@yahoo.com
          Hardware: PC
            Status: NEW
           Version: 7.0.29
         Component: Catalina
           Product: Tomcat 7

After a dispatch via AsyncContext, the 'Content-Type' header does not appear in
the response on the client side even though it is set on the server side via
response.setContentType(String).

A project demonstrating the issue:
https://github.com/rstoyanchev/dispatch-test

Checkout the source from the 'tomcat-issue-repro' branch. When the application
is deployed, from the home page choose the "JSON content" scenario. The
scenario involves one Servlet that creates a thread and dispatches to a second
Servlet that sets the contentType property of the response to
"application/json" and writes some JSON content. However, the 'Content-Type'
header does not appear in the response. For details on the setup see
WebAppInitializer.setupJsonSecnario(ServletContext).

----

FWIW, if forwarding is used from the application thread instead of a dispatch
through the AsyncContext, the response contains the 'Content-Type' header. To
see that modify the line that sets up servlet "JsonA" in
WebAppInitializer.setupJsonScenario(ServletContext) to create a
ForwardingAsyncServlet instead of a DispatchingAsyncServlet.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to