17 JSP Taglib Directive
17 JSP Taglib Directive
Menu ▼
JSP Taglib directive
The JSP taglib directive is used to define a tag library that defines many tags. We use
the TLD (Tag Library Descriptor) file to define the tags. In the custom tag section we
will use this tag so it will be better to learn it in custom tag.
Syntax JSP Taglib directive
1. <%@ taglib uri="uriofthetaglibrary" prefix="prefixoftaglibrary" %>
Example of JSP Taglib directive
In this example, we are using our tag named currentDate. To use this tag we must
specify the taglib directive so the container may get information about the tag.
1. <html>
2. <body>
3.
4. <%@ taglib uri="http://www.javatpoint.com/tags" prefix="mytag" %>
5.
6. <mytag:currentDate/>
7.
8. </body>
9. </html>