我这样写判断是否为空,但是为什么就出错了 #if({empty user})当后台返回来的user为空时就出错了,页面打不开
页面应该是 JSP页面吧 ~
<c:if test="${empty user}">
user is empty or null.
</c:if>
<c:if test="${not empty user}">
user is NOT empty or null.
</c:if>
还有记得要引入 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
var user="${user}";
if(user!=null&&user!=""&&user!=undefined){
}