- <c:if>没有<c:else>可以用<c:choose>来取代结构:
- <c:choose>
- <c:when test=""> 如果
- </c:when>
- <c:otherwise> 否则
- </c:otherwise>
- </c:choose>
-
- 举一个典型的 <c:choose>、<c:when>和<c:otherwise>范例:
- <c:choose>
- <c:when test="${condition1}">
- condition1为true
- </c:when>
- <c:when test="${ condition2}">
- condition2为true
- </c:when>
- <c:otherwise>
- condition1和condition2都为false
- </c:otherwise>
- </c:choose>