tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Squires <>
Subject TEI to get info from a outer tag
Date Wed, 07 Feb 2001 13:20:37 GMT

I have the following tags in my taglib:

<example:parent attrib1="fish">
	<example:results parentTag="parent">
		do something with results
		e.g. <%=parent.getId()%>

The parent goes off and gets a collection of bean's that the generic results
tag iterates round.  The parent tag name is the same as the bean name to
make it easier for the jsp programmer to use.
The parentTag attribute of the results tag is used by the resultsTEI class
to generate the variable info (see code snip below).

What I have on my wish list is a way of getting the parentTag name from the
actual parent tag.  E.g. for the tag <example:company>, the parentTag
attribute of results would have to be "company".  The TEI class cannot get
anything from the parent tag because it seems to be parsed at compile time,
not runtime.  Therefore the results tag can go get the details of it's
parent but those details can never be passed on to the TEIclass, it always
receives the defaults for the required values.

Any ideas would be great,


  public VariableInfo[] getVariableInfo( TagData data )
    String name = data.getAttributeString( "parentTag" );
    String type = "com.example.beans."+name;
    String alias = data.getAttributeString( "alias" );
    if ( alias != null )
       name = alias;

    //System.out.println( "class = "+type );
    return new VariableInfo[]
      new VariableInfo( name,


Tim Squires
Wireless Data Services
It's not what you know, it's who you tell.

View raw message