JSTL 判断对象是否为空

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

判断集合和对象是否为空:
list为集合,user为对象名
<c:if test="${empty user}">无user信息!TODO...</c:if>
<c:if test="${!empty list}">list集合不为空判断,TODO...</c:if>
<c:if 判断对象是否为空
<c:if test="null==user||user.isEmpty()"></c:if>
<c:else集合不为空</c:else>
or<c:if test="null!=user&&!user.isEmpty()">
集合不为看空</c:if>

 

posted @ 2015-11-06 15:35  fenglie  阅读(1264)  评论(0)    收藏  举报
版权所有,转载声明