<c:choose>、<c:when>和<c:otherwise>在一起连用,可以实现Java语言中的if-else语句的功能。
用法:
<c:choose>
<c:when test="${detail[0].ordOutletsname != null && !empty detail[0].ordOutletsname}"> <!--判断指定的字段不为null 并且不为空 -->
</c:when>
<c:otherwise> <!-- 否则-->
</c:otherwise>
</c:choose>
本文介绍如何使用JSP标准标签库(JSTL)中的<c:choose>、<c:when>和<c:otherwise>标签来实现类似于Java中的if-else语句的功能,用于对数据进行条件判断。
1228

被折叠的 条评论
为什么被折叠?



