tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <>
Subject Re: Indirect jsp:include does not seem to work
Date Fri, 01 Apr 2005 18:39:51 GMT
You cannot perform a forward inside an include. [Just like you can't set any 
headers, including cookies,  in an include or a host of other things while in 
an include.]


Michael J. wrote:

> Hello all,
> I have master jsp page, and I try to jsp:include
> page="/", which forwards to detail jsp page,
> but this does not work. On Tomcat 4.x and 5.x the detail
> page content is included, but further content from the
> master page is stripped out.
> According to jsp specs, if I include a resource with
> jsp:include, its content should be included in the page.
> Afaik the spec does not specify nesting level.
> I looked in the code. ApplicationDispatcher correctly
> identifies the first request to as "Path
> Based Include". But when struts action forwards to detail
> jsp, ApplicationDispatcher identifies it as "Path Based
> Forward". doForward() is called instead of doInclude(), and
> ApplicationDispatcher flushes and closes the response
> writer. Thus, Jasper cannot write the rest of master page
> content to writer, and throws
> "org.apache.jasper.JasperException: Stream closed".
> Without thinking much, I commented out writer flushing in
> ApplicationDispatcher.doForward(). It seems to work on
> Tomcat 4.1.31, but failed on Tomcat 5.0. Anyway, I am not
> sure that I did a right thing and that all buffers are properly being
> closed now. Would be great if Tomcat devs look into it.
> Btw, Jetty does not work as I want, too. BUT: I tried to create a
> "proxy" JSP page, which is included in main JSP page. This proxy page
> includes, which forwards to real JSP page that I want
> to include (whew!) Jetty works perfectly fine with this proxy JSP
> page!
> Also, Resin works fine both with direct including of struts action
> from main page, and with proxy JSP page.
> So, I believe that this is a Tomcat bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message