[Top] [Prev] [Next] [Bottom]

Taglib Directive

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

JSP Syntax

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

Examples

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

<public:loop>
.
.
</public:loop>

Description

The taglib directive declares that the JSP file 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 file. You can use more than one taglib directive in a JSP file, but the prefix defined in each must be unique.

In JSP 1.0, the method of creating portable custom tags that can be recognized by any servlet engine is not yet defined. Some JSP engines might allow you to create custom tags, but those tags might not be recognized by other JSP engines.

Attributes

See Also



[Top] [Prev] [Next] [Bottom]

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