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

《转载》jstl中if-else实现

JSP 标准标签库(JSTL) | 菜鸟教程
https://www.runoob.com/jsp/jsp-jstl.html

 


————————————————
版权声明:本文为CSDN博主「漫步moonwalk」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/u014070729/article/details/52126108/

相关文章: