JSP standard Tag Library (JSTL)--jstl Introduction and Installation

Source: Internet
Author: User
Tags tld

For the MVC design pattern, we have always emphasized that the fewer Scriptlet code in a JSP clock, the better, but only by the previous concept is difficult to achieve, because the development of the label is particularly troublesome, so in order to simplify the label, but also to make the label more common, so generally in the development (without the use of framework) , you can use the Jstl component to complete the development task.

JSTL:JSP standard tag library,jsp tag library.

Development environment: JDK1.6, Tomcat6.0, Jstl stable version is 1.2

Download down Jstl-1.2.jar, which mainly has the following tag library categories:

1. C.tld: Core Tag library, defines attribute management, iteration, judgment, output

2. Sql.tld:sql Tag Library, defines the query database operation

3. X.tld:xml Tag library for manipulating XML data

4. FN.TLD: Function Tag Library, provides some common operation functions, for example: string function

5. Fmt.tld:I18N format Tag library, format data

can be removed directly from the jar package and placed in the working directory D:\Workspace\WEB-INF

Then put the jar bag into the D:\apache-tomcat-7.0.57\lib.

To verify the JSP:

<%@ page contenttype= "text/html" pageencoding= "GBK"%><%[email protected] taglib prefix= "C" uri= "/web-inf/ C.tld "--%><%@ taglib prefix=" C "uri=" Http://www.mldn.cn/jst/core "%>

This label is equivalent to completing an attribute =out.println ().

Web. XML setting, you can replace the second line with the third row

<jsp-config> <taglib> <taglib-uri>http://www.mldn.cn/jst/core</taglib-uri><taglib-location>/WEB-INF/c.tld</taglib-location> </taglib> <taglib> < Taglib-uri>http://www.mldn.cn/jst/fmt</taglib-uri><taglib-location>/WEB-INF/fmt.tld</taglib-location> </taglib> <taglib> &L T;taglib-uri>http://www.mldn.cn/jst/fn</taglib-uri><taglib-location>/WEB-INF/fn.tld</taglib-location> </taglib> <taglib> &lt ; Taglib-uri>http://www.mldn.cn/jst/sql</taglib-uri><taglib-location>/WEB-INF/sql.tld</taglib-location> </taglib> <taglib> &L T;taglib-uri>http://www.mldn.cn/jst/x</taglib-uri><taglib-location>/WEB-INF/x.tld</taglib-location> </taglib> </jsp-config>

JSP standard Tag Library (JSTL)--jstl Introduction and Installation

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.