tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "TechHelp Support" <>
Subject Re: Ambiguity with respect to setParent() and tag files
Date Tue, 27 Apr 2004 15:27:28 GMT
We have received several emails from your email address by a blind copy.
We are the technology support help desk for the Cobb County School
System. I am sure these emails are being sent to us in error.  

>>> 4/27/2004 11:21:19 AM >>>

I am trying to resolve an ambiguity with respect to
javax.servlet.jsp.tagext.[Simple]Tag.setParent() and tag files. If I
place a
tag (simple or classic, doesn't matter) at the top-level within a tag
should it have a parent? I had expected that its parent would be the
SimpleTag that is the tag file itself, thus providing a parent chain
the calling JSP, but the Tomcat 5.0.19 implementation sets its parent
null. The JSP 2.0 specification and JavaDoc say only "The setParent()
is only called if the element is nested within another tag invocation."
could interpret this to mean nested statically, in which case the
behavior is correct, or nested dynamically, in which case it is

It would be extremely useful if a tag within a tag file that expects,
example, a transaction context provided by an ancestor tag, could
communicate with that ancestor tag even if the ancestor is in the JSP
invoked the tag file. Otherwise, I can't generally take a portion of my
and make it reusable by putting it into a tag file. In implementation,
interpretation would mean that a tag at the top level within a tag
should be initialized with "setParent(this)" (or "setParent(new
TagAdapter(this))") instead of "setParent(null)".

I have sent an e-mail to the JSR-152 address to request a spec
clarification. Any opinions here on the correct behavior?

Tony Deigh
RepWire, Inc.

To unsubscribe, e-mail: 
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message