Creating and Editing Tags

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 Adding Tag Files to a Web Module 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 generate skeleton Java code for a tag handler that is based on the tag, attribute, and variable elements and on the specifications that you supply in the Tag Customizer dialog box. You then edit the tag handler code directly to insert the logic that implements the features of the tag.

warning  Only TLD files that conform to JSP 1.1 or 1.2 specifications can be edited in the customizer and used to generate tag handlers. Other versions are treated as XML files and must be edited in the Source Editor.

To add a tag element to a TLD file:

  1. In the Filesystems window, right-click the tag library descriptor's (TLD) node.
  2. Choose Add Tag from the contextual menu. The Add New Tag dialog box appears.
  3. In the Add New Tag dialog box, edit the tag. See the Tag Customizer Fields section later in this topic for more information.
  4. Click OK to have the changes take effect immediately and to dismiss the Add New Tag dialog box.

To edit a tag:

  1. In the Filesystems window, right-click the tag and choose Customize from the contextual menu.
  2. In the Tag Customizer dialog box, edit the tag. See the Tag Customizer Fields section later in this topic for more information.
  3. Click OK to have the changes take effect immediately and to dismiss the Tag Customizer. Click Apply to apply the changes without dismissing the Tag Customizer.

The Tag Customizer dialog box tracks the selection in the Filesystems window and shows the properties of any tag that is selected.

Tag Customizer Fields

Fields on the General page include:

Fields on the Code Generation page include:

Fields on the Icons page include:

When the tag library is used by a GUI tool, the tool can use these icons to represent the tag library.

For more information about creating and using custom tags, see JavaServer Pages Specification available at http://java.sun.com/products/jsp/download.html.

See Also
Creating and Editing Tag Attributes
Creating and Editing Scripting Variables
Generating Java Source Tag Handlers

Legal Notices
 
 
 

 

See Also