tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Garth Patil" <garthpa...@gmail.com>
Subject Re: Critical bug in RequestDispatcher.include(..) in Tomcat 5.5.16 ?
Date Sat, 01 Jul 2006 19:03:13 GMT
Sorry. I don't think I read your initial post closely enough the first
time. It appears that the DefalutServlet (when called in this fashion)
that is serving the static html resource is closing the output stream.
The Servlet specification seems to indicate that attempts to do that
should be ignored by the implementation:
"The include method of the RequestDispatcher interface may be called
at any time.
The target servlet of the include method has access to all aspects of
the request
object, but its use of the response object is more limited.
    It can only write information to the ServletOutputStream or Writer of the
response object and commit a response by writing content past the end of the
response buffer, or by explicitly calling the flushBuffer method of the
ServletResponse interface. It cannot set headers or call any method that affects
the headers of the response. Any attempt to do so must be ignored."

Given that this seems to be a Tomcat implementation problem, perhaps
this should be brought up on the tomcat-dev list. In the meantime,
users should use @include or jsp:include if they want to do this in a
jsp.
<%@ include file="/foo.html" %>
<jsp:include page="/foo.html" />

Best,
Garth

On 7/1/06, j.random.programmer <javadesigner@yahoo.com> wrote:
> > I didn't see him mention "forward", you do
> > understand what he's saying
> > right?
> >
>
> No I don't. Which is why this looks like a fairly
> serious bug from
> where I am standing. You may want to read the
> specification about
> what an "include" is and how it differs from
> "forward".
>
> The spec. explicity states that "forwards" close the
> output stream before
> returning but "includes" DO NOT and that the include
> method of the
> request dispatcher may be called anytime (and as many
> times).
>
> You do understand that part of the spec ?
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

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


Mime
View raw message