Programming WebLogic JSP Tag Extensions
Main Steps for Creating Custom JSP Tags
Perform the following steps to create and use custom JSP tags:
- Write a tag handler class. When you use a custom tag in your JSP, this class executes the functionality of the tag. A tag handler class implements one of two interfaces:
javax.servlet.jsp.tagtext.BodyTag
or javax.servlet.jsp.tagtext.Tag
. Your tag handler class is implemented as part of a tag library. For more information, see Implementing the Tag Handler.
- Reference the tag library in your JSP source using the JSP
<taglib>
directive. A tag library is a collection of JSP tags. Include this directive at the top of your JSP source. For more information, see Referencing a Tag Library.
- Write the Tag Library Descriptor (TLD). The TLD defines the tag library and provides additional information about each tag, such as the name of the tag handler class, attributes, and other information about the tags. For more information, see Creating a Tag Library Descriptor.