JSP Syntax (8)

Source: Internet
Author: User
Tags resource rfc
js| Syntax Taglib instruction

Defines a tag library and its prefix for a custom label.



JSP syntax

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

Example

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

<public:loop>

.

.

</public:loop>

Describe

<% @ taglib%> directive declares that the JSP file uses a custom label, references the tag library, and also specifies the prefix of their tags.



The custom label here contains the label and the element. Because JSP files can be translated into XML, it is important to understand the links between tags and elements. The label is simply a markup that is raised in a sense and is part of the JSP element. The JSP element is part of the JSP syntax and has the same start and end tags as XML. Elements can also contain other text, tags, and elements. For example, a jsp:plugin element has a <jsp:plugin> start tag and a </jsp:plugin> end tag, and can also have <jsp:params> and <jsp:fallback> Elements.



You must use the <% @ taglib%> directive before using a custom label, and you can use it more than once in a page, but the prefix can only be used once



Property

Uri= "Uritotaglibrary"

The Uniform Resource Identifier (URI) uniquely names a custom label based on the prefix of the label, which can be the following:



 



Uniform Resource Locator (URL), defined by RFC 2396, view http://www.hut.fi/u/jkorpela/rfc/2396/full.html

 



Uniform Resource Name (URN), defined by RFC 2396

 



A relative or absolute path

prefix= "TagPrefix"

Prefixes before custom labels, such as public in <public:loop>, if this is not public, then this is illegal. Please do not use JSP, Jspx, Java, javax, servlet, Sun, and sunw as your prefix


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.