0% found this document useful (0 votes)
58 views1 page

17 JSP Taglib Directive

The JSP taglib directive is used to define a tag library and associate it with a URI and prefix. It references a TLD file that defines the tags. In the example, the taglib directive imports the tag library from "http://www.javatpoint.com/tags" and uses the prefix "mytag" so that the <mytag:currentDate/> tag can be used to display the current date.

Uploaded by

Sapana Pardeshi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views1 page

17 JSP Taglib Directive

The JSP taglib directive is used to define a tag library and associate it with a URI and prefix. It references a TLD file that defines the tags. In the example, the taglib directive imports the tag library from "http://www.javatpoint.com/tags" and uses the prefix "mytag" so that the <mytag:currentDate/> tag can be used to display the current date.

Uploaded by

Sapana Pardeshi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Content 

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>  

You might also like