In the JSP page development process, often need to use the Jstl (Java Server Pages standard tag Library) tab Open Development page, it seems more regular and comfortable. JSTL provides 5 major categories of tag libraries:1. Core Tag Library: provides common support for everyday tasks, such as displaying and setting variables, reusing a set of items, testing conditions, and other actions such as importing and redirecting Web pages.2. Internationalization (i18n) Tag Library: a reference program that supports multiple languages.3. SQL Tag Library: provides standardized support for accessing and modifying databases.4. XML Tag library: Provides support for XML file processing and manipulation, including parsing of XML nodes, iterative, conditional evaluation based on XML data, and execution of Extensible Style language Transformations (extensible Style Language transformations, XSLT).5. Function Tag Library: Implements a specific operation by invoking a function in the function tag library in an El expression, for example: ${fn:contains (sring,substring)}, whose function is to determine whether the string string contains substring strings. Jstl Tag Library use method: Tag library URI prefix using pattern Core Tag library http://java.sun.com/jstl/core C <c:tagname...>internationalization label (i18n) http://java.sun.com/jstl/fmt FMT <fmt:tagname...>SQL Tag Library http://Java.sun.com/jstl/sql SQL <sql:tagname...>XML Tag Library http://java.sun.com/jstl/xml x <x:tagname...>Function Tag Library http://java.sun.com/jstl/functions fn <fn:tagname...>A common use of the core tag library is syntax:<% @taglib prefix="C"Uri="Http://java.sun.com/jsp/jstl/core"%>the commonly used labels are<c:Set var="name"Value="Eric"Scope="Request"></C:Set><c: outValue="${pagescope.name}" default="<p> China </p>"Escapexml="false"></C: out>"0"End="2"items="${requestscope.contacts}"step="1" var="Stu"varstatus="Varstu">sequence number: ${varstu.count} name: ${stu.name} Gender: ${stu.gender} Age: ${stu.age}<br></c:foreach><c:Set var="language"Value="-php-java-python-js-"Scope="Session"></C:Set><c:fortokens items="${sessionscope.language}"delims="-" var="LAN">${lan}<br/></c:fortokens><c:removevar=""/><c:Set var="score"Value=" -"Scope="Session"></C:Set> <c:choose> <c:when test="${score>=90}">Excellent results</c:when> <c:when test="${score<90 && score>=80}">Good grades</c:when> <c:when test="${score>=60 && score<80}">Pass the Grade</c:when> <c:otherwise>Fail to pass the grade</c:otherwise> </c:choose>
REDIRECT Label
<c:redirect url= "www.baidu.com" >
<c:param name= "" Value= "" ></c:param>
</c:redirect>
If you use an instance tag in a JSP page, the class you need to use conforms to the JavaBean specification
1) with or without a parametric constructor
2) properties are private
3) All properties are Getter/setter
3 commonly used methods in JSP pages
<jsp:usebean id= " stu " class =" pkg2. Student " ></jsp:useBean> <jsp:setproperty Property= " name " Name= " stu " value=" alex "/> <jsp:getproperty property=" Span style= "COLOR: #800000" >name " name=" stu "/>
JSP common tags in the Java web