<body>
<!-- scope不设置即为一次性 -->
<c:set var="test1" value="${2000*2}" scope="session"></c:set>
删除前:
<c:out value="${test1}"></c:out>
</br>
<c:remove var="test1" scope="session" />
删除后:
<c:out value="${test1}"></c:out>
</br>
</br>
<!--c:if标签 -->
<c:set var="test2" value="200"></c:set>
<c:if test="${test2 > 0}">
c:if标签
</c:if>
</br>
</br>
<!-- c:choose标签 -->
<c:set var="test3" value="200"></c:set>
<c:choose>
<c:when test="${test3==200 }">
test3=200
</c:when>
<c:when test="${test3==100 }">
test3=200
</c:when>
<c:otherwise>
test都不是
</c:otherwise>
</c:choose>
</br>
</br>
<!-- c:forEach -->
<c:forEach var="i" begin="1" end="5" step="1" >
Item <c:out value="${i}"></c:out></br>
</c:forEach>
</br>
</br>
<%
List<String> list = new ArrayList<String>();
list.add("hello");
list.add("hi");
list.add("goodmorning");
request.setAttribute("data", list);
%>
<c:forEach items="${data}" var="i" varStatus="status">
${status.count}:${i}</br>
</c:forEach>
</body>
运行结果如下: