(一)代码如下
例如:<c:when test="${dealObjectId!=''}"> </c:when>的时候是错误的,不起作用。jstl判断无用。
改正:改为 <c:when test="${!empty dealObjectId}"></c:when>即可成功解决。
(二)使用说明:
<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:elseor<s:if test="null!=user&&!user.isEmpty()"
集合不为看空</s:if