tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: RequestDispatcher breaks cookies, response headers
Date Sat, 04 Nov 2000 22:56:47 GMT
Colin Evans wrote:

> Hi, I believe I  have found a bad bug in the RequestDispatcher
> implementation.  If I do a successful RequestDispatcher.include() from one
> servlet to another, it appears that no HTTP response headers are returned
> except for "Content-Type".  Everything else seems to respond correctly.
> "Location", "Content-Length", and "Servlet-Engine" headers as well as
> headers set in the servlet are not returned, and neither are any session or
> user cookies returned.  This basically breaks all
> model-view-controller-based sites that use cookies, and for me is a serious
> bug.
> I've seen the problem on Tomcat 3.1 and 3.2b6.  I'm running NT4.0 with Sun
> JDK 1.2.2.  I would appreciate ideas on work-arounds or patches.


Are you saying that the *included* servlet is trying to set some
headers/cookies, and they are not showing up?  If so, that is the way it is
supposed to work.  Servlet 2.2 Specification, section 8.3:

    The include method of the RequestDispatcher interface may be called
    at any time.  The target servlet has access to all aspects of the request
    object, but can only write information to the ServletOutputStream or
    Writer of the response object as well as the ability to commit a response
    by either writing content past the end of the response buffer or
    explicitly calling the flush method of the ServletResponse interface.
    The included servlet cannot set headers or call any method that affects
    the headers of the response.  Any attempt to do so should be ignored.

If this is not the situation you are describing, could you please provide a bit
more information?

> Thanks!
> Colin Evans

Craig McClanahan

View raw message