EL三目表达式

EL表达式没必要判断是否为空,如果为空,EL表达式会自动不显示
直接${user.name}这样就可以了

三目的话,试试${(empty user.name)?"":user.name} 这样写也许会报错,
实际运行应该是对的或者不用三目,直接写

<c:if test="${!(empty user。name)}">${user.name}</c:if>
原文地址:https://www.cnblogs.com/dashen/p/4445071.html