tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Cooper" <martin.coo...@tumbleweed.com>
Subject Re: How to determing the relationship between tags
Date Wed, 05 Dec 2001 22:27:00 GMT
True, but that doesn't solve the particular problem I was describing. If you
are breaking up a page into multiple pages because the compiled size blows
the JVM limit, you have to use <jsp:include>. The include directive includes
at compile time, so you're no better off than when you started.

--
Martin Cooper


----- Original Message -----
From: Dan Gross <dan.gross@sun.com>
To: Tag Libraries Users List <taglibs-user@jakarta.apache.org>
Sent: Wednesday, December 05, 2001 2:05 PM
Subject: Re: How to determing the relationship between tags


> If you use an include directive, like:
>
> <%@ include file="pageContainingTag2.jsp" %>
>
> instead of a JSP include, then findAncestorWithClass() will work.
>
> --Dan
>
> Martin Cooper wrote:
>
> >One thing to be aware of with findAncestorWithClass() is that it works
only
> >within the JSP page. This is not surprising in itself. However, if you
want
> >to be able to have the nested tag in an included page, you can't use this
> >mechanism to find the parent.
> >
> >That is, with this code in the page:
> >
> >  <mytags:tag1 ... >
> >      <mytags:tag2 ... />
> >  </mytags:tag1>
> >
> >tag2 can find tag1 using findAncestorWithClass() just fine. However, with
> >this:
> >
> >  <mytags:tag1 ... >
> >      <jsp:include page="pageContainingTag2.jsp" />
> >  </mytags:tag1>
> >
> >tag2 will be unable to find tag1 using findAncestorWithClass().
> >
> >It may not always be necessary to be able to do this, but I point it out
> >because we had this issue with the Struts HTML tags. The various <html:*>
> >tags need to refer to their containing <html:form> tag. However, if the
form
> >gets very large, and the page breaks the limit on the size of a compiled
> >method, you are forced to split the form across pages. To make this work
in
> >Struts, the doStartTag() method in <html:form> stores a reference to
itself
> >as a request attribute, the nested tags use that, and then doEndTag()
cleans
> >it up.
> >
> >--
> >Martin Cooper
> >
> >
> >----- Original Message -----
> >From: Shawn Bayern <bayern@essentially.net>
> >To: Tag Libraries Users List <taglibs-user@jakarta.apache.org>;
> ><bo@groupserve.com>
> >Sent: Wednesday, December 05, 2001 12:20 PM
> >Subject: Re: How to determing the relationship between tags
> >
> >
> >>On Wed, 5 Dec 2001, bo wrote:
> >>
> >>>I wonder if I can determine the relationship among tags, such as tag A
> >>>should be within tag B etc. Is that possible? Thanks!
> >>>
> >>You can use a TagLibraryValidator class to enforce arbitrary
> >>characteristics of the XML view of a JSP page, including specific
> >>relationships among tags.  For an example of a SAX-based approach to
> >>validation, see the JstlCoreTLV class in the "Standard" taglib.
> >>
> >>Tags can also, at runtime, gain access to their parent tag handlers.
The
> >>most convenient mechanism for doing this is, in most cases, the static
> >>TagSupport.findAncestorWithClass() method, part of the JSP API.
> >>
> >>Hope that helps,
> >>
> >>Shawn
> >>
> >>
> >>--
> >>To unsubscribe, e-mail:
> >>
> ><mailto:taglibs-user-unsubscribe@jakarta.apache.org>
> >
> >>For additional commands, e-mail:
> >>
> ><mailto:taglibs-user-help@jakarta.apache.org>
> >
> >
> >
> >--
> >To unsubscribe, e-mail:
<mailto:taglibs-user-unsubscribe@jakarta.apache.org>
> >For additional commands, e-mail:
<mailto:taglibs-user-help@jakarta.apache.org>
> >
>
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:taglibs-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:taglibs-user-help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-user-help@jakarta.apache.org>


Mime
View raw message