Creating a Tag Handler

See Also

You can develop tag handlers for JSP custom actions using Java classes or tag files. This topic discusses how to use the IDE to create tag handlers using Java code. See Creating a tag file for information about tag files.

The IDE provides tools for creating a TLD file and for adding tag elements, tag attribute elements, and variable elements to the TLD file. You can create Java code for a tag handler by using the New File wizard and then you can edit the tag handler code in the Source Editor to modify the logic that implements the features of the tag.

tip  Before you can create a tag handler, you have to create its tag library descriptor (a TLD file). See Creating a tag library descriptor for information about TLD files.

To create a tag handler:

  1. In the Projects window or Files window, right-click the project node.
  2. From the pop-up menu, choose New > Other.
  3. Under Categories, select Web. Under File Types, select Tag Handler. Click Next.
  4. Type the class name of the tag handler.
  5. Type the package name of your tag handler.
  6. Select BodyTagSupport if you want to write complex tags, such as nested tags or iteration tags. Otherwise, leave the default SimpleTagSupport selected.
  7. Click Next.
  8. Define the tag handler's TLD information.

For a full guide to creating and using tag handlers, see:

See Also
About Tag Library Descriptors

Legal Notices