Runtime components : Channels components : HTML Channel : Tasks : Creating a new JSP tag
  
Creating a new JSP tag
This section describes how to create a new JSP tag. JSP tags are responsible for rendering HTML pages based on the attributes of the tag.
To create a new JSP tag, complete the following steps:
1 Create a Java class that inherits from DSETagSupport class.
The class DSETagSupport is in the com.ibm.btt.gui.jsptags package.
2 Add the required attributes to the class and implement the setters for these new attributes according to the following convention:
public void setNewAttributeName(String newAttributeValue)
where the "N" in NewAttributeName must be an uppercase letter.
3 Implement the doStartTag and doEndTag methods, adding the corresponding logic associated with the open and close tag (such as <dse:newTag> and </dse:newTag>
4 Add the definition of the new tag into the tag library descriptor (you may choose to create a new tag library descriptor or update the one provided with the product, which is dse.tld).
The following information must be added to the TLD file:
<tag>
<name>newTagName</name>
<tagclass>fullQualifiedNewClassName</tagclass>
<bodycontent>EMPTY</bodycontent>
<info>New tag description</info>
<attribute>
<name>attributeName1</name>
<required>true</required>
</attribute>
<attribute>
<name>attributeName2</name>
<required>false</required>
</attribute>
</tag>
where:
name is the value used in the JSP (<dse:newTagName>)
tagClass is the class implementing the tag behavior
bodyContent provides information about the contents of the tag. Following are the possible values:
EMPTY means that there are no contents between the open tag and the close tag
TAGDEPENDENT means that the contents between the open tag and the close tag will be evaluated by the tag implementation itself. It may be empty, too.
JSP means that the contents between the open tag and the close tag will be evaluated by some other tag of the JSP. It may be empty, too.
info is just a description
Result: 
All the attributes must be declared here, including the ones inherited from the parent classes. These are the attributes that will be accepted by the JSP during the development process, and the required parameter is used by the tooling facilities to give an error if a mandatory attribute is missing.
Go up to
Tasks