JSP's Taglib Directiv

Source: Internet
Author: User
Tags definition resource
JS JSP pages are used to define a tag library and prefix using taglib directive from the definition tag.

   its syntax:

<%@ taglib uri= "uritotaglibrary" prefix= "TagPrefix"%


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


The <%@ taglib%> Directive (Directive) allows you to use custom labels, name the tag libraries, and specify their prefixes.

The term custom tag does not just refer to the label, but also to the element. Because JSP files can be translated into XML, it is important to understand the relationship between tags and elements. The label is just a flag (markup) and is part of the JSP element. A JSP element is a JSP syntax unit that is equivalent in XML to a start tag and an end tag. An element can contain other text, labels, or elements. For example, a jsp:plugin element always ends with the <jsp:plugin> label beginning and one </jsp:plugin>, and can also contain a <jsp:params> element and a <jsp:fallback> element.

Before you use a custom label in a JSP file, you must use a <%@ taglib%> indication. You can use multiple <%@ taglib%> instructions in a JSP file, but each prefix defined above must be unique.

   attribute Detailed:

Uri = "Uritotaglibrary"
Uniform Resource definition (uri--the uniform Resource Identifier)
A URI can be in the following form:
A Uniform resource location defined by RFC2396 (url--the uniform Resource Locator) can be obtained at this site:
A Uniform Resource name (urn--the uniform Resource name) defined by RFC2396.

Related Article

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.