You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Caldarale, Charles R" <Ch...@unisys.com> on 2009/01/30 16:59:14 UTC

RE: Servlet 2.5 and RequestDispatcher.include + Response.setHeader, invalid?

> From: Ken Johanson [mailto:tomcat-user@kensystem.com]
> Subject: Re: Servlet 2.5 and RequestDispatcher.include +
> Response.setHeader, invalid?
>
> Do you know if that rule applies only to the Request
> object passed by the RequestDispatcher, or should the
> container also prevent this if the original Request
> was purposely passed into the dispatched handler, in
> order to allow it to set headers/status?

Good question; sounds like yet another ambiguity in the spec.  I'd have to dig through the code to find out how Tomcat currently handles that situation, and that's not likely to happen today.  Hopefully one of the committers can answer that.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Servlet 2.5 and RequestDispatcher.include + Response.setHeader, invalid?

Posted by Ken Johanson <to...@kensystem.com>.
Caldarale, Charles R wrote:
>> From: Ken Johanson [mailto:tomcat-user@kensystem.com]
>> Subject: Re: Servlet 2.5 and RequestDispatcher.include +
>> Response.setHeader, invalid?
>>
>> Do you know if that rule applies only to the Request
>> object passed by the RequestDispatcher, or should the
>> container also prevent this if the original Request
>> was purposely passed into the dispatched handler, in
>> order to allow it to set headers/status?
> 
> Good question; sounds like yet another ambiguity in the spec.  I'd have to dig through the code to find out how Tomcat currently handles that situation, and that's not likely to happen today.  Hopefully one of the committers can answer that.
> 
>  - Chuck
> 
> 

Before someone decides to commit code that "fixes" this, I would submit 
that the behavior should remain as-is; because if the calling servlet is 
purposefully conveying the original request object to a dispatched 
handler, then the callee should be allowed to set them. There are no 
doubt others who rely on this behavior right now, since there are some 
cases in where forward() or filters are not suitable. I too am looking 
for predictability / stability...

-k



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org