【发布时间】:2016-05-07 16:18:32
【问题描述】:
如何在JSTL中使用if?我想做这样的事情。
<c:if ${order.products} == NULL>
a
else
b
</c:if>
【问题讨论】:
标签: jstl
如何在JSTL中使用if?我想做这样的事情。
<c:if ${order.products} == NULL>
a
else
b
</c:if>
【问题讨论】:
标签: jstl
我相信语法是这样或类似的。
<c:choose>
<c:when test="${order.products == null}">
a
</c:when>
<c:otherwise>
b
</c:otherwise>
</c:choose>
【讨论】:
<c:if>而不是<c:when>
试试这个:
<c:choose>
<c:when test="${order.products == null}">
a
</c:when>
<c:otherwise>
b
</c:otherwise>
</c:choose>
【讨论】: