jsp页面获取后台传过来的list集合的长度

在jsp页面导入函数标签库:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
list的长度是:${fn:length(list)}
就可以在页面标签中对后台传过来的list的长度进行判断
<c:if test="${fn:length(list)<=0}">
  <img style="100%;height:auto;" src="${contextPath}/webpage/weixin/noInfo.png" alt="">
</c:if>
在jsp页面中不能通过${list.size}取列表长度。

原文地址:https://www.cnblogs.com/shuilangyizu/p/11314055.html