Thanks for your reply.

Unfortunately, (I forgot to mention) that I need to be able to do this
dynamically (I need to be able to define the file to include at
request-time).

The <%@ include file="...%> mechanism is a JSP directive which means that it
happens at compile time (and hence is not changeable at request-time).

Thanks anyway.

Any other ideas?

...alex...


----- Original Message -----
From: "Shane Witbeck" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 30, 2001 10:53 AM
Subject: Re: Using a jsp:include action (JSP 1.1) within a BodyTag taglib
tag


Im completely new to JSP (within the last week) but have you tried using a
directive include instead of an action include.

i.e.: <%@ include file="filename" %> (which is done at compilation time
instead of request processing time.) instead of <jsp:include page="filename"
/> (which is done at request processing time)

Just read about this so forgive my ignorance if Im way off base with my
suggestion.

Shane


-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Alex Tang
Sent: Tuesday, January 30, 2001 1:16 PM
To: [EMAIL PROTECTED]
Subject: Using a jsp:include action (JSP 1.1) within a BodyTag taglib
tag


hi folks.  (Sorry for the wide distribution, this question seems to span
both the JSP and taglib realm).

I'm having a problem with the interaction of a taglib BodyTag and a
jsp:include action (or an equivalent taglib tag that uses a
pageContext.forward()).  For example, if I have:

     <foo:myBodyTag>
       Blah Blah...
       <jsp:include page="..."/>
     </foo:myBodyTag>

The output from the jsp:include action always appears BEFORE the output
from the myBodyTag taglib tag.

(BTW, I'm using Tomcat 3.1)

In reading the JSP 1.1 spec, section 5.4.5 says


     The BodyContent Class

     The BodyContent is a subclass of JspWriter that can be used to
     process body evaluations so they can retrieved later on. The
     class has methods to convert its contents into a String, to
     read its contents, and to clear the contents.

     The buffer size of a BodyContent object is "unbounded". A
     BodyContent object cannot be in autoFlush mode. It is not
     possible to invoke flush on a BodyContent object, as there is
     no backing stream. This means that it is not legal to do a
     jsp:include when out is not bound to the top-level JspWriter.

     ...

>From the last sentence, does this mean that it is illegal to use a
jsp:include action (or an equivalent taglib tag that performs a
pageContext.include()) within a BodyTag?

Is there a way to get around this in JSP 1.1 (Specifically Tomcat 3.x)?
Would setting the page buffer to none help?  (If so, what problems or
drawbacks are there for settign the page buffer to none?)

I've looked through the JSP 1.2 spec (although not completely), and I
did not see any mention of this type of restriction.  Is this correct?

I realize that this is somewhat contanier specific, but does anyone know
if Tomcat 4.x allow for jsp:include actions within a BodyTag?

Thank you for your time.

...alex...

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to