The C tag we use in web development is the core library in Jstl, providing common support for everyday tasks
<C:SET>: Setting variable values and Object properties
<c:set value= "value var=" variable name "scope=" variable's scope "target=" Object name property= "object property name" ></c:set>
<C:OUT>: Display variable contents in page
No label body:
Has the label body:
<c:out value= "value" escapexml= "{true|false}" default= "Default Value" > label Body </c:out>
Conditional label:<c:if> <c:choose> <c:when> <c:otherwise>
No label body:
<c:if test= "test condition" var= "variable name" [scope= scope]/>
Has the label body:
<c:if test= "test condition" var= "variable name" [scope= scope]>
<c:when> <c:otherwise> cannot be used alone and can only be used as a child label for <c:choose>.
These three tags combine to implement the functionality of the switch statements in Java. The syntax is as follows:
<c:choose>
<c:when test= "${user.class== ' guest '}" >
tag body 1
</c:when>
<c:when test= "${user.class== ' VIP '}" >
label body 2
</c:when>
<c:otherwise>
label Body 3
</c:o Therwise>
</c:choose>
Iteration Label:
<c:forEach> <c:forTokens> to traverse an object collection
<c:foreach var= "variable name" items= "collection" varstatus= "Traversal state name" begin= "Begin" end= "End" step= "Step" >
label body
</c:forEach>
<c:fortokens>: Used to traverse a string, and each traversal result returns a word in the string.
<c:fortokens items= "string" delims= "delimiter" var= "variable name" varstatus= "Traversal state name" begin= "Begin" end= "End" step= "Sep" >
tag Body
</c:forTokens>
<c:url>: Used to encode URL addresses.
Has the label body:
<c:url value= "url" context= "path" var= "variable name" scope= "Scope" >
The following code:
<c:url value= "http://localhost:8080/el/index.jsp" var= "Newurl" >
<c:param "name" name= "Zero"/ >
<c:param name= "age" value= "/>
</c:url>
<a href=" ${newurl} "> Dot me </a>
Generated url:http://localhost:8080/el/index.jsp?name=zero&age=28
No label body: used primarily for editing context URLs.
<c:url value= "url" context= "path" var= "variable name" scope= "Scope"/>
The following code:
<c:url value= "/logon.jsp" > Login </c:url>
If the current path is El, the output is:/el/logon.jsp
。。。。。。