我一直在尝试评估这个数组列表是否为空,但这些数据列表都没有编译:
<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}">
Run Code Online (Sandbox Code Playgroud)
如何评估ArrayList是否为空?
bob*_*nce 243
空是一个操作员.
<c:if test="${empty myObject.featuresList}">
Run Code Online (Sandbox Code Playgroud)
Ste*_* B. 67
还有功能标签,更灵活一点:
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<c:if test="${fn:length(list) > 0}">
Run Code Online (Sandbox Code Playgroud)
而这里的标签文档.
| 归档时间: |
|
| 查看次数: |
158384 次 |
| 最近记录: |