It may return the Tag interface to you, but you can always cast it down to
the specific custom tag you need.  If you know the Tag reference you have is
really an instance of MyParentTag, you can just cast it to that and work
with it that way.  For example:

        MyParentTag tag = (MyParentTag) findAncestor(...);

Just be sure that the reference you have is to the particular tag or you get
the old faithful ClassCastException.

-----Original Message-----
From: Pernikoff, Ben [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 16, 2000 2:38 PM
To: [EMAIL PROTECTED]
Subject:


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. Problem is I can't call
methods on the outer one. findAncestor WithClass() brings me the proper tag
instance to the inner tag but I can't call it's methods because a it comes
back as a Tag and I don't have access to this particular instance's methods.
Any ideas? Do I have to use reflection to accomplish this? Thanks to anyone
who can help.

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

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