Taglib command
Define a tag Library and the prefix of its custom tags.
JSP syntax
<% @ Taglib uri = "uritotaglibrary" prefix = "tagprefix" %> |
Example
<% @ Taglib uri = "http://www.jspcentral.com/tags" prefix = "public" %> <Public: loop> . . </Public: loop> |
Description
The "% @ taglib %" command declares that the JSP file uses custom tags, reference the tag library, and specify the prefix of their tags.
Here, custom tags include tags and elements. Because JSP files can be converted to XML, it is important to understand the relationship between tags and elements. A tag is only a tag that is elevated in the sense and is part of a JSP element. JSP elements are part of the JSP syntax, and have the start tag and end tag like XML. An element can also contain other text, tags, and elements. For example, a JSP: plugin element includes the start tag of JSP: plugin and the end tag of/jsp: plugin. jsp: Params and JSP: fallback can also be used.
You must use the % @ taglib % command before using a custom tag, and you can use it multiple times on a page, but the prefix can only be used once.
Attribute
Uri = "uritotaglibrary" The Uniform Resource Identifier (URI) uniquely names a custom tag Based on the tag prefix. The URI can be the following: Uniform Resource Locator (URL), defined by RFC 2396. For details, see http://www.hu.fi/u/jkorpela/rfc/2#/full.html. Uniform Resource Name (URN), defined by RFC 2396. |
A relative or absolute path
The prefix before the custom tag, for example, public in, is invalid if no public is written here. Do not use JSP, jspx, Java, javax, Servlet, sun, or sunw as your prefix.