close

 

介紹一下jstl的<c:if>

這個tag 並沒有else

只能單純的作<c:if test=XXXXX....>

 

若想要實現if else  要用 <c:choose> <c:when>

Ex:

<c:choose>

      <c:when test="${user.valid}">

          XXXXXXXXX

      </c:when>

      <c:when test="${user.isTrue}">

          bbbbbbbbbbbbbbbbb

      </c:when>

      <c:otherwise >

          cccccccccccc

      </c:otherwise>

</c:choose>

 

 

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 JoshS 的頭像
    JoshS

    JoshS的部落格

    JoshS 發表在 痞客邦 留言(0) 人氣()