<div th:if="${tblUserList != null}">
--content--
</div>
上面的 thymeleaf 代码不起作用,其中 tblUserList 是一个列表。所以我想检查列表是否为空而不是检查它的空值。如何做到这一点?
最佳答案
您可以进行如下操作:
<div th:if="${not #lists.isEmpty(tblUserList)}">
--content--
</div>
关于html - 如何使用 thymeleaf 检查列表是否为空?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33106391/