jstl中if-else實現


<c:when test="${studentneedsignBO.status != 1 }">
<span>不需要簽到</span>
</c:when>
<c:otherwise>
<c:if test="${studentneedsignBO.signStatus == 1 }">
<span>準時簽到</span>
</c:if>
<c:if test="${studentneedsignBO.signStatus == 2 }">
<span>超時簽到</span>
</c:if>
<c:if test="${studentneedsignBO.signStatus == 3 }">
<span>未簽到</span>
</c:if>
</c:otherwise>

</c:choose>


JSTL中<c:if>標籤沒有對應的else因此採用

<c:choose> 

     <c:when test="">    <!--如果 --> 

 </c:when>      

     <c:otherwise>  <!--否則 -->    

  </c:otherwise> 

</c:choose>




其他相關標籤查詢下面網址:

http://www.runoob.com/jsp/jsp-jstl.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章