c标签判断对象是否为空
1.便签库引入:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
2. 元素对象user
<c:if test="${empty user}">为空</c:if>
<c:if test="${!empty user}">不为空</c:if>
<c:if test="${not empty studentList}">非空</c:if>
当然也可以写成
<c:if test="${user !=null && user !=""}">
不为空,<c:out value="${user }" />
</c:if>
声明:该文观点仅代表作者本人,入门客AI创业平台信息发布平台仅提供信息存储空间服务,如有疑问请联系rumenke@qq.com。
- 上一篇:没有了
- 下一篇: html设置图片加载时、加载错误时显示的默认图
