<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: