JSP Tag Lib directive

A user can customize actions from their tag file using the Tag Lib directive. The Tag Lib directive is a collection of custom tags.

The syntax of Tag Lib directive is:

<%@ taglib uri = “tag library URI” prefix = “tag Prefix” %>

In the above, taglib and uri are both keywords. The URI, which can be absolute or relative, uniquely identifies the tag library descriptor and is enclosed with” “ in tag library URI. The tag prefix included inside ” ” is a string that will become the prefix to distinguish a custom action.

If the custom tag has a content body, then the format for using a custom tag in taglib directive is as follows:

<prefix:tagName>body</prefix:tagName>

If the custom tag does not have content body, then the format for using a custom tag in taglib directive is as follows:

<prefix:tagName/>

Leave a Reply

Your email address will not be published. Required fields are marked *