"Pernikoff, Ben" wrote:

> I am building a custom taglib and I am looking for a way to pass nested jsp
> tags to the outer tag so that the outer tag will have access to the inner
> one's properties. I thought I would pass an instance of my inner tag to the
> outer one with an addTag () method in the outer one and store them. Is there
> a way built into jsp or a relatively easy way to do this? Do I have to use
> reflection to accomplish this?
>

By the time that the outer tag was able to act on the reference to the inner tag
instance, that inner tag would have been released (and possibly recycled).  Thus,
any reference to the inner tag would be useless.

A different approach to this problem could be something like this:  in the inner
tag, you can follow the chain of parent tags until you find the outer tag that you
want.  Then, call some property setter methods on the outer tag instance to save
whatever information you want to keep.

Craig McClanahan

===========================================================================
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