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>
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。
- 上一篇: jsp if else c标签 总结
- 下一篇: Socket长连接和短连接的区别