<c:if 判断对象或集合是否为空

判断集合和对象是否为空:

list为集合,user为对象名
<c:if test="${empty user}">无user信息!TODO...</c:if>为空
<c:if test="${!empty list}">list集合不为空判断,TODO...</c:if>非空

 

<s:if 判断对象是否为空

<s:if test="null==user||user.isEmpty()">
集合为空
</s:if><s:else>
集合不为空
</s:else>

or
<s:if test="null!=user&&!user.isEmpty()">
集合不为看空
</s:if>

相关文章:

  • 2021-10-19
  • 2022-01-13
  • 2022-01-06
  • 2021-10-12
  • 2021-05-22
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-06
  • 2022-12-23
  • 2021-09-24
  • 2021-06-14
  • 2021-11-27
相关资源
相似解决方案