You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Tim Squires <Ti...@uk.wdsglobal.com> on 2001/02/07 14:20:37 UTC

TEI to get info from a outer tag

Hi,

I have the following tags in my taglib:

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

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,
Tim.

------

  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,
                        type,
                        true,
                        VariableInfo.NESTED
                        ),
    };
  }

---------------

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