I. Overview of JSTL
JSTL (JSP Standard Tag Library), JSP standard tag libraries, can be embedded in the JSP page using the form of tags to complete the business logic and other functions. The purpose of Jstl appears to be the same as El to replace the script code in the JSP page. JSTL standard standard Tag Library has 5 sub libraries, but with the development, it is often used in his core library
Second, Jstl download and import
Jstl Download:
Download the Jstl jar package from the Apache Web site. Go to the "http://archive.apache.org/dist/jakarta/taglibs/standard/binaries/" url to download the JSTL installation package. Jakarta-taglibs-standard-1.1.2.zip and then unzip the downloaded JSTL installation package, at which point you can see two jar files in the Lib directory, Jstl.jar and Standard.jar respectively. Where the Jstl.jar file contains the interfaces and related classes defined in the JSTL specification, Standard.jar file contains the. class file for implementing Jstl and the 5 tag library descriptor files (TLD) in Jstl
Import two jar packages into the lib of our project
Import the core tag library using the JSP's taglib directive
third, Jstl Core library of the common label 1 <c:if test= "" > Label
Where test is a condition that returns a Boolean
2) <c:forEach> label
There are two combinations of ways of using:
<%@ page language= "java" contenttype= "text/html;
Charset=utf-16 "pageencoding=" UTF-16 "%> <%@ taglib uri=" Http://java.sun.com/jsp/jstl/core "prefix=" C "%> <!
DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" > Operation Effect:
<%@ page language= "java" contenttype= "text/html; Charset=utf-16 "
pageencoding=" UTF-16 "%>
<%@ page import=" java.util.* "%>" <%@ taglib "uri=
" Http://java.sun.com/jsp/jstl/core "prefix=" C "%>
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" >