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

  • A+
所属分类:Java Spring

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: