The use of Jstl tag library is detailed

Source: Internet
Author: User
Tags control label

in a previous blog EL expression , we introduce the simple use of El expression, but at the same time using El expression, is generally combined with jstl to use together, this article we will introduce the background of JSTL, classification, its use in the program!


JSTL (JSP standardtag library,jsp standard Tag library) is a constantly improving open source JSP tag Library, which is maintained by Apache's Jakarta team. Jstl can only be run on and above containers that support the JSP1.2 and Servlet2.3 specifications, such as Tomcat 7.x. It is also supported as a standard in JSP 2.0.

JSTL 1.0 was released in June 2002 and consists of four custom tag libraries (core, format, XML, and SQL) and a pair of common tag library validators (SCRIPTFREETLV and PERMITTEDTAGLIBSTLV). The core tag library provides custom actions to manage data by limiting the scope of variables, as well as performing iterations and conditional actions on page content. It also provides tags for generating and manipulating URLs. As the name implies, the format tag library defines the operations that are used to format data, especially numbers and dates. It also supports the internationalization of JSP pages using localized resource bundles.


The JSTL Core Tag library (c tag) has a total of 13 tags, functionally divided into 4 categories:
1. Expression control Tags: out, set, remove,catch
2. Process Control Label: If, choose, when,otherwise
3. Loop Label: ForEach,fortokens
4.URL action tag: import, URL, redirect


If we're going to use these tags in our program, first we're going to introduce a jar, where we're going to introduce two jars, Jstl-1.2.jar and Standard-1.1.2.jar, and then put the two jars into the Lib folder under Web-inf. Then on our JSP page to introduce <%@ tagliburi= "Http://" prefix= "C"%> so that we can use the JSP page on the Jstl!

Below we look at the use of these tags in the code!

<span style= "FONT-SIZE:18PX;" ><%@ page language= "java" contenttype= "text/html; charset=gb18030 "pageencoding=" GB18030 "%><%@ taglib uri=" Http:// "prefix=" C "%> <%@ page import= "java.util.*"%><! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://" >

by writing simple code on the top, we can easily know how to use it in our application!

The use of Jstl tag library is detailed

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: 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.