thymeleaf判断list或字段非或非空的方法

  • A+
所属分类:Java

---
title: thymeleaf判断list或字段非或非空的方法
date: 2018-07-27 08:54:31
categories:
- Java
- Spring
tags:
- thymeleaf
- null
- 空
- list
- "th:if"
---

thymeleaf里判断List为空的写法:

th:if="*{#lists.isEmpty(h_sntkinfHeaderlst)}"

 

判断list非空的写法:

th:if="*{not #lists.isEmpty(h_sntkinfHeaderlst)}"

 

普通字段同样可用上面的#lists.isEmpty来判断

ZPY

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: