Adding custom JSP tags

You can create custom JSP tags for your Web projects based on the Sun Microsystems JSP 1.2 Specification.Tag libraries are usually created by developers who are proficient in the Java programming language and can be used by Web designers who might not know Java, but would like to enhance their Web site by taking advantage of Java encoded tag libraries.

Implementing custom tags requires all of the following:

A TLD file can be packaged within a JAR file, or as a separately existing project file. If the TLD file is packaged in a JAR file, it must be included under the META-INF folder.

You can add your custom tag library and tag library descriptor files to your project as you would any other project file.

To add custom JSP tags, you typically follow this process:

  1. Adding the Tag Library Descriptor (TLD) file.

  2. Adding a taglib directive to a JSP file.

  3. Specifying the taglib directive.

  4. Adding a custom tag to a JSP file.

  5. Editing the properties of a custom tag (optional).

  6. Editing a Web deployment descriptor file for a custom tag library (optional).

 

Related concepts

Custom tag libraries

 

Related tasks

Adding the Tag Library Descriptor (TLD) file
Adding a taglib directive to a JSP file
Specifying the taglib directive
Adding a custom tag to a JSP file
Editing the properties of a custom tag
Editing a Web deployment descriptor file for a custom tag library

Related reference
Tag libraries