tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Serge Knystautas <>
Subject Re: JSP with taglibs -- output in wrong order without flush?
Date Wed, 26 Jul 2000 10:29:30 GMT
Michael Taylor wrote:
> The spec that said that it was illegal to use <jsp:include> in a context
> where 'out' was not the current writer, or something like that.  I think
> this means that it's illegal to use <jsp:include> within the body of a
> tag.  The spec claims this is because there is no backing stream behind
> the body of this tag, which makes sense.  It's my guess that
> <jsp:include> always writes to the top-level writer directly.

I'm pretty sure this is the case for the reasons you give.  I'd like a
way around that though in the next version of the servlet API. ;)

> This may have something to do with my problem.  I am calling
> RequestDispatcher to include pages from my start and end tags and I know
> this is exactly equivalent to what <jsp:include> does.  Specifically I
> have the following type of code:

I actually wrote a tag for my own purposes this week that does include
and forward from within a tag.  It works, but what I did was use the
include(String relativeURI) method on the PageContext object.  I'm
assuming this was added specifically for this purpose
(including/forwarding from a tag library).  I'm happy to say it works
better than I had hoped (i was expecting it to give an
IllegalStateException or something like that), although I do have to
call flush in the doStartTag() method (actually, I call clearBuffer
because of the tag's use, but that's irrelevant... I was still having
flushing problems).  I actually do the include in the doAfterBody()
method, so I assume if it can include another JSP there, it can do it in
any method.

Serge Knystautas
Loki Technologies

View raw message