评估列表是否为空JSTL

问题描述 投票:120回答:2

我一直在尝试评估此数组列表是否为空,但是这些都没有被编译:

<c:if test="${myObject.featuresList.size == 0 }">                   
<c:if test="${myObject.featuresList.length == 0 }">                 
<c:if test="${myObject.featuresList.size() == 0 }">                 
<c:if test="${myObject.featuresList.length() == 0 }">                   
<c:if test="${myObject.featuresList.empty}">                    
<c:if test="${myObject.featuresList.empty()}">                  
<c:if test="${myObject.featuresList.isEmpty}">  

我如何评估ArrayList是否为空?

java jsp jstl
2个回答
243
投票

empty运算符是prefix


67
投票
© www.soinside.com 2019 - 2024. All rights reserved.