Adding a custom tag to a JSP file

When you choose to insert a custom tag, Page Designer references the taglib directive and displays the tags from that custom library. Once you have specified the taglib directive, you need to add the custom tags to a JSP file, in order for the editor to recognize the tags you specified.
Prerequisites:
  1. Adding the Tag Library Descriptor (TLD) file.
  2. Adding a taglib directive to a JSP file.
  3. Specifying the taglib directive.
To add a custom tag to a JSP file, do the following:
  1. Open the JSP file in Page Designer.
  2. From the main menu click JSP > Insert Custom. The Insert Custom Tag wizard opens.
  3. Select a URI in the Tag libraries in document list. The custom tags available for that URI display. If the tag library is not listed, click Add to add the tag library.
  4. Select the custom tag that you want to insert from the Custom tags in selected tag library list and click Insert. The custom tag is inserted.
  5. When you have finished inserting the custom tag, click Close.

In the Design page, the Custom tag Custom tag icon icon indicates a custom tag. A dashed line surrounding the icon indicates that its content is JSP. A solid line surrounding the icon indicates that its content is empty or tag-dependent. When inserting a custom tag whose content is empty or tag-dependent into an existing JSP page, the custom tag replaces the selected fragment.

You can also customize the appearance of the icon by using preferences. Select Window > Preferences > Web Tools > Page Design > Appearance > Editing Symbols. In the Editing Symbols group, you can select one of the following options to determine how custom tags will be displayed in the Design page: Show editing symbols for:
  • line-break
  • comment
  • script
  • JSP - Show with icon
  • JSP - Show with icon and text
Note: In JSP 1.2 TLD files, each custom tag can have an optional small icon that can be used by the tools. If a small icon is specified for a custom tag, the icon is used in the Design page in place of the default icon.
Now that you have added the custom tag to your JSP file, you can edit the properties of the custom tag.
Related concepts
Custom tag libraries
Related tasks
Adding custom JSP tags
Adding the Tag Library Descriptor (TLD) file
Adding a taglib directive to a JSP file
Specifying the taglib directive
Editing the properties of a custom tag
Editing a Web deployment descriptor file for a custom tag library
Related reference
Tag libraries

Feedback