jsp Taglib Directive

Introduction:

The JavaServer Pages API allows you to define custom JSP tags that look like HTML or XML tags and a tag library is a set of user-defined tags that implement custom behavior.
The taglib directive declares that your JSP page uses a set of custom tags, identifies the location of the library, and provides a means for identifying the custom tags in your JSP page.

Syntax

<%@ taglib uri="uri" prefix="prefixOfTag" >

Attributes:

Taglib  directive contains two attributes

1.prefix : prefix attribute informs a container what bits of markup are custom actions.

 2.uri : uri represents the location of tag libraries.

Example:

<%@ taglib uri="http://www.example.com/custlib" prefix="mytag" %>
<html>
<body>
<mytag:hello/>
</body>
</html>

Thanks For Making This Possible! Kindly Bookmark and Share it.

Technorati Digg This Stumble Stumble Facebook Twitter

No comments:

Post a Comment