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 Project 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 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 independent tag library descriptor, taglib.tld.
- Click Finish to add your independent tag library to your WEB-INF folder.
- Add the custom tag library to the Web project:
- In the Project 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.
- 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 Insert from the main menu.
- You can also create the tag library descriptor file when you create your Dynamic Web project. On the Features Page of the New Web Project wizard, select the Add Struts support 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
Custom tag libraries
Related tasks
Adding custom JSP tags
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
Tag libraries