![]() |
The Package Tool helps to build an archive of taglib components. The archive consists of tag classes, other classes, and XML tag library descriptor file. The Tag Library Descriptor (TLD) file describes a tag library. A JSP container uses the a TLD to interpret pages that include taglib directives that refer to the related tag library. The TLD is also used by JSP page authoring tools that generate JSPs, and by authors who create JSPs, manually.
To create a taglib, select Tools > Package > Taglib > New.
Enter the name of the Taglib in the dialog that appears. The taglibs are saved under the specified JAR node in the desk. Click OK to create a new Taglib JAR. Edit the following details under the details section:
There are three ways to store taglibs and using them in a JSP.
The first method is recommended, as using the given structure requires no changes to be made while packaging the WAR. To know more about the second method, read the section on Packaging Web Components.
Tools > Package > Taglib Name > Right Click > Add Tag
Select the Tag to be added to the Taglib and click on OK. This adds the Tag to the Taglib and the details can subsequently be viewed in the Tag node. Selecting the Tag name displays the details on the right hand side of the window. The following details of the tag are displayed here. These details are not editable:
Add and Remove the attributes that the tag requires to be written in the taglib descriptor file. Set the following sub-elements of the attribute here:
To delete a tag that has been added to the taglib JAR, click on Delete. After adding all the tags in the taglib JAR, assemble the taglib JAR into a WAR file.
Taglib file on the Desk> Right Click > Update
This updates the taglib, static content like HTML, images and all classes. If the package names of the above are changed, then the changed components are not updated. Files like HTML, and images are stored with their absolute paths and therefore may not be located if they have been moved from their original location.
A time stamp based update is used to update the taglibs, which makes the updating faster in most scenarios. Choosing Update brings up a dialog box with a progress bar. All the updating messages are displayed here. To stop updating the taglib, click on Cancel. Studio in the meantime can be used as usual but the taglib file being updated cannot be opened.
A log of update operations is available on the Update Tab in the Output area of Studio. This log shows normal messages in black, updating messages in green and any failures or errors in red. Usually a remedial measure is also provided in the case of errors. A progress bar indicates the progress of the operation.
Tools > Package > Taglib > Save saves the open Taglib.
Tools > Package > Taglib > Close. This command closes the current Taglib. The Taglib is saved before closing.
Tools > Package > Taglib > Revert restores the taglib to its last saved state.
The META-INF/taglib.tld file corresponding to the Taglib JAR can be viewed in the XML node.
| Pramati Technologies © Copyright |
|