JSP Beginner's Introductory tutorial taglib Directiv

Source: Internet
Author: User
Tags definition resource

Use the JSP page to define a tag library and prefix using taglib directive from the definition tag.

Its syntax:

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

Example:

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

.

Describe:

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 label beginning and one , and can also contain a element and a 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:

Property

Usage

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.

C

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.