Adding the Tag Library Descriptor (TLD) file
In order to implement custom JSP tags, add the Tag Library Descriptor (TLD) file (taglib.tld) to your project.
To add the taglib.tld file to your project, complete the following steps:
- Add the independent tag library descriptor, taglib.tld to your WEB-INF folder:
- In the Enterprise Explorer view of the Web perspective, select the
WebContent/WEB-INF folder in your Web project.
- Right-click the
WEB-INF folder and select
Import. The Import wizard opens.
- Click
General | File System Then click Next.
- In the File System page of the Import wizard, click Browse to select the directory from which you want to import your independent tag library descriptor, taglib.tld.
- Select the tid file from the tree viewer on the wizard
- Click Finish to add your independent tag library to your WEB-INF folder.
- Add the custom tag library to the Web project:
- In the Enterprise Explorer view of the Web perspective, right-click the Web project and select
Import. The Import wizard opens.
- Click
File System | Next.
- In the File System page of the Import wizard, click Browse to select the directory from which you want to import your custom tag library.
- Select the tid file from the tree view on the wizard
- Click Finish to add your custom tag library to your Web project.
Tip:
- If a TLD file is packaged in a JAR file, you can also import the TLD from the
Insert Custom Tag dialog box, available by selecting
JSP
Insert Custom from the main menu.
- You can also create the tag library descriptor file when you create your Dynamic Web project. On the Project Facets page of the New Web Project wizard, select the
Struts check box. The wizard automatically adds the tag library descriptor (TLD) file to your dynamic Web project.
Now that you have added the TLD file to your project, you can add a taglib directive to your JSP file.
Related concepts
Related tasks
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