BBS水木清华站∶精华区
发信人: agents (智能代理), 信区: Java
标 题: JSP语法(8)
发信站: BBS 水木清华站 (Tue Jan 2 14:50:44 2001)
【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 JSPengines.
▲[Attributes]
(1)uri="URIToTagLibrary"
The Uniform Resource Identifier (URI) that uniquely names the set of custom
tags associated with the named tag prefix. A URI can be any of the following
A Uniform Resource Locator (URL), as defined in RFC 2396
A Uniform Resource Name (URN), as defined in RFC 2396
An absolute or relative pathname
(2)prefix="tagPrefix"
The prefix that precedes the custom tag name, for example, public in
<public:loop>. Empty prefixes are illegal. If you are developing or using
custom tags, you cannot use the tag prefixes jsp, jspx, java, javax, servlet
, sun, and sunw, as they are reserved by Sun Microsystems.
--
※ 修改:·agents 於 Jan 2 16:14:02 修改本文·[FROM: 166.111.54.22]
※ 来源:·BBS 水木清华站 smth.org·[FROM: 166.111.54.22]
BBS水木清华站∶精华区