A simple distillation of my previous e-mail is:
Why won't tomcat let me do a "flush" inside a custom tag (other app servers
haven't complained). I.e. I want to do a jsp:include inside a custom tag.
<ipa:ifUserLoggedIn>
<jsp:include page="/footers/logged_in.html" flush="true"/>
</ipa:ifUserLoggedIn>
Any help greatly appreciated.
-Richard
----- Original Message -----
From: "Richard Sand" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 25, 2001 3:33 PM
Subject: bizarre page flushing situation
> Hi all- I've got the following somewhat whacky setup which Tomcat refuses
to
> handle. It involves custom tags and included JSP pages. My tomcat is
3.2.2
> on W2K running native (i.e. no external web server).
>
> At the bottom of all of my JSP pages I include a JSP footer as follows:
>
> <%@ include file="/footer.jsp" %>
>
> Inside footer.jsp, I display a footer that is customized to whether the
user
> is logged in, which is determined by custom tags. Footer.jsp looks as
> follows:
>
> <ipa:ifUserLoggedIn>
> <jsp:include page="/footers/logged_in.html" flush="true"/>
> </ipa:ifUserLoggedIn>
>
> <ipa:ifUserNotLoggedIn>
> <jsp:include page="/footers/not_logged_in.html" flush="true"/>
> </ipa:ifUserNotLoggedIn>
>
> So here's the problem: I get the exception:
>
> java.io.IOException: Illegal to flush within a custom tag
>
> but ONLY when I use those particular custom tags inside the footer. If I
> use them in the main jsp pages they work fine.
>
> I also tried removing the flush=true, but tomcat replies:
>
> org.apache.jasper.compiler.CompileException: ... jsp:include needs to have
> "flush=true"
>
> On other application servers, I didn't have the flush=true and they worked
> fine.
>
> Lastly, the doAfterBody of the tags is very basic:
>
> try {
> // write the body and return SKIP_BODY
> bodyContent.writeOut(bodyContent.getEnclosingWriter());
> return SKIP_BODY;
> } catch (Exception e) {
> throw new JspException(e.toString());
> }
>
>
> Can anyone explain this behavior???
>
> Thanks for your help!
>
> Best regards,
>
> Richard
>
>