- 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.
- Reference the Tag Library Descriptor in the Web Application deployment
descriptor (web.xml). For more information, see Writing Web Application
Deployment Descriptors.
- Use your custom tag in your JSP. For more information, see
Using Custom Tags
in a JSP.