Taglib Directiv of JSP

Source: Internet
Author: User

You can use Taglib Directive to customize a tag library and prefix on the jsp (preferred for SUN Enterprise Applications) page.

  Its Syntax:

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

  Example:

<% @ Taglib uri = "http://www.jsp (preferred for SUN Enterprise Applications) central.com/tags" prefix = "public" %>
<Public: loop>
.
</Public: loop>

  Description:

<% @ Taglib %> direve ve allows you to use custom tags, name the library, and specify their prefixes.

The term "custom tag" is not only a tag, but also an element. Because jsp (preferred for SUN Enterprise Applications) files can be converted to xml (standardization is getting closer and closer), it is important to understand the relationship between tags and elements. Tags are just a sign (markup) and are part of jsp (preferred for SUN Enterprise applications. The jsp (preferred for SUN Enterprise Applications) element is a jsp (preferred for SUN Enterprise Applications) syntax unit, which is in xml (standardization is getting closer and closer) the price is equal to one start tag and end tag. An element can contain other text, tags, or elements. For example, a jsp (the preferred choice for SUN enterprise-level applications): The plug-in element always takes <jsp (the preferred choice for SUN enterprise-level applications ): plugin> tag start and end with a </jsp (preferred for SUN Enterprise Applications): plugin>. It can also contain a <jsp (preferred for SUN Enterprise Applications ): params> elements and <jsp (preferred for SUN Enterprise Applications): fallback> elements.

Before using a custom tag in the jsp (preferred for SUN Enterprise Applications) file, you must use an <% @ taglib %> instruction. You can use multiple <% @ taglib %> indications in a jsp (preferred for SUN Enterprise Applications) file. However, each prefix defined earlier must be unique.

  Attribute details:

Attribute
Usage
Uri = "URIToTagLibrary"
Uniform Resource definition (URI -- The Uniform Resource Identifier)
A URI can be in the following format:
A unified Resource location (URL -- The Uniform Resource Locator) defined in RFC2396 can be obtained at this site:
A unified Resource Name (URN -- The Uniform Resource Name) defined by RFC2396 ).
C

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.