O'Reilly logo

Sams Teach Yourself J2EE™ in 21 Days by Peter Roxburgh, Andy Longshaw, Debbie Law, Dan Haywood, Martin Bond

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Defining Tag Extra Info Objects

Every custom tag can have an optional Tag Extra Info (TEI) object. The TEI object is used for two purposes:

  • To validate tag attributes at page translation time

  • To specify the scripting variables created by the tag

A TEI class extends the javax.servlet.jsp.tagext.TagExtraInfo class and is defined to the TLD before the tag's body content definition. The following example defines an OptionTagTEI class for the OptionTag used in the case study:

<tag>
    <name>option</name>
    <tag-class>web.OptionTag</tag-class>
    <tei-class>web.OptionTagTEI</tei-class>
    <body-content>empty</body-content>

The TEI class itself must define methods to validate attributes and define scripting variables. These uses of the TEI class are presented ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required