<c:choose > (EL表達式 使用if else的條件)
<c:when test="${list.replyContent!=null}">已回覆</c:when>(if條件 如果成立就在頁面輸出已回覆)
<c:otherwise></c:otherwise>(else否則不輸出,想要輸出的話可以再<c:otherwise></c:otherwise> 標籤中加具體的輸出內容)
</c:choose>
<c:choose > (EL表達式 使用if else的條件)
<c:when test="${list.replyContent!=null}">已回覆</c:when>(if條件 如果成立就在頁面輸出已回覆)
<c:otherwise></c:otherwise>(else否則不輸出,想要輸出的話可以再<c:otherwise></c:otherwise> 標籤中加具體的輸出內容)
</c:choose>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:if test="${empty str}"> str爲空</c:if> <c:if test="${not empty str}"> s
[size=medium][color=red]<c:choose>、<c:when>、<c:otherwise>標籤標籤相當於Java代碼中的if.
[size=medium][color=red]<c:set>可以往變量裏設值,根據scope屬性設定範圍,從而在不同地方可以取到,默認是page範圍
[color=green][size=medium]實例:JstlCoreServlet.java代碼如下:package com.bjpowerno
<c:forEach begin="1" end="${pager.pageCount}" var="no" > <option value='${no}'>${no}</option> </c: