[转]EL表达式判断是否为空,判断是否为空字符串

原文地址:https://blog.csdn.net/zhaofuqiangmycomm/article/details/79442730.net

El表达式判断是否为空字符串

${empty 值}  返回true ,表示为空字符串;

 

  <c:if test=" ${empty  basicTree.phone} ">

<td>wwww </td>

</c:if>

 

 

El表达式判断是否为空

${值 eq  null } 返回true 的话,表示为空

<c:if test="${basicTree.phone eq  null }">

<td>mmmm</td>

</c:if>  


双保险判断不为空


<c:if test="${not empty basicTree.phone && !(basicTree.phone eq null) }">
哈哈  
</c:if>

blog