Alex Tang wrote:

> Hi folks.
>
> I was wondering...Is it possible to have a custom taglib tag produce (or
> reproduce the semantics) of "<jsp:include page=.../>"?  l
>

Yes.  Inside the tag's implementation you can use PageContext.include() for this,
or use a RequestDispatcher directly.

>
> I have the same question about "<%@ include" directive.
>

No.  <%@ include %> directives are processed at compile time, not at run time, so
there is no opportunity for a custom tag to be invoked.

>
> What I'm trying to do is: using a taglib directive, include a separate
> JSP file.  The name of that JSP will not be known when writing the JSP
> file (hence the taglib tag).  Also, at some point, there may be some
> level of recursion, so an included JSP file can include another using
> the same mechanism.
>
> Is this possible?  I'm not sure i fully understand the differences
> between "<jsp:inculde" and "<%@include" in terms of which requires
> moreoverheadand whatnot.  I can be flexible about which one I should use
> (if any)
>

The difference is run time versus compile time.  For more info on this (and all the
other features of JSP), see the JSP Specification, version 1.1, at
<http://java.sun.com/products/jsp/download.html>.

>
> Thanks.
>
> ...alex...
>

Craig McClanahan

====================
See you at ApacheCon Europe <http://www.apachecon.com>!
Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
                                    Applications to Tomcat

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
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