`

JSTL获取list的大小

    博客分类:
  • jsp
 
阅读更多
JSTL获取list的大小,jstl获取list 的长度,EL表达式获取list的长度,EL表达式获取list大小


在jsp页面中不能通过${list.size}取列表长度,而是
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<c:out value="${fn:length(list)}"></c:out>

不足10行补空行
<c:forEach begin= "${fn:length(list)}" end = "${10 - fn:length(list)}">
<tr><td></td></tr>
</c:forEach>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics