Contents | Prev | Next


Taglib Directive

Defines a tag library and prefix for the custom tags used in the JSP page.

JSP Syntax

<%@ taglib uri="URIForLibrary" prefix="tagPrefix" %>

XML Syntax

None. However, see <jsp:root>.

Examples

<%@ taglib uri="http://www.jspcentral.com/tags" prefix="public" %>	
	
<public:loop>	
   ...	
</public:loop>

Description

The taglib directive declares that the JSP page uses custom tags, names the tag library that defines them, and specifies their tag prefix.

You must use a taglib directive before you use the custom tag in a JSP page. You can use more than one taglib directive in a JSP page, but the prefix defined in each must be unique.

Tutorials on creating custom tags are available at http://java.sun.com/products/jsp/taglibraries.html#tutorials.

Attributes

See Also



Contents | Prev | Next

Copyright © 2002, Sun Microsystems, Inc. All rights reserved.