tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colin Evans" <cev...@bitmo.com>
Subject Re: RequestDispatcher breaks cookies, response headers
Date Sun, 05 Nov 2000 00:15:02 GMT

Headers set in the outermost servlet are not returned.  No headers are
returned at all, except for "Content-type".  HTTP session cookies that
Tomcat is supposed to set automatically are not returned at all.  The
"Content-Length" and "Servlet-Engine" headers that Tomcat faithfully sets
automatically for all servlet requests are not returned in this case.
Cookies added in the outermost servlet are not returned.

-Colin
--
Colin Evans
Bitmo, Inc. (http://www.bitmo.com)
(415)920.7225 / cevans@bitmo.com


----- Original Message -----
From: "Craig R. McClanahan" <Craig.McClanahan@eng.sun.com>
To: <tomcat-dev@jakarta.apache.org>
Sent: Saturday, November 04, 2000 3:52 PM
Subject: Re: RequestDispatcher breaks cookies, response headers


> Colin Evans wrote:
>
> > When a RequestDispatcher.include() is done, *no* return headers are set
at
> > all, except for "Content-Type".  It doesn't matter where the headers are
> > set.  This includes return headers that the Tomcat container is supposed
to
> > set automatically for all servlet requests, such as "Content-Length" and
> > "Servlet-Engine" headers and any HTTP session cookies.
>
> Where are you trying to set the headers?  As I pointed out from the spec,
an
> included servlet is not allowed to set them -- only the outermost calling
> servlet can do so.
>
> >
> > RequestDispatcher.forward() seems to function correctly.  My guess is
that
> > Tomcat is supposed to delete any return headers set during an include
and
> > not touch headers set by the dispatching servlet, and instead it is
deleting
> > all of the return headers set during the request, including headers that
> > should be returned as per the spec.
>
> There was a bug in 3.1 that caused headers set before a forward call to be
> thrown away, but that's been fixed in 3.2.  A forwarded-to servlet is
allowed to
> set headers, but not an included servlet.
>
> >
> > I hope this helps; let me know if you need more explanations.
> >
> > -Colin
> >
>
> Craig
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message