Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsp 如何获取foreach jstl标记中的项数?_Jsp_Jstl - Fatal编程技术网

Jsp 如何获取foreach jstl标记中的项数?

Jsp 如何获取foreach jstl标记中的项数?,jsp,jstl,Jsp,Jstl,我在javascript下有以下代码: 纬度[“${loop.index}”]=; 经度[“${loop.index}”]=; lastEvent=“${loop.index}”; 如果(“${loop.index}”>0) waypointEvents[“${loop.index}”]=新的google.maps.LatLng(纬度[“${loop.index}]”,经度[“${loop.index}]”); 如何知道LifeEvents列表中存在的LifeEvents的确切数量?如果您的

我在javascript下有以下代码:


纬度[“${loop.index}”]=;
经度[“${loop.index}”]=;
lastEvent=“${loop.index}”;
如果(“${loop.index}”>0)
waypointEvents[“${loop.index}”]=新的google.maps.LatLng(纬度[“${loop.index}]”,经度[“${loop.index}]”);

如何知道LifeEvents列表中存在的LifeEvents的确切数量?如果您的lifeEvents是一个集合,那么在运行整个循环直到C结束之前,您可以使用jstlfn:length

<c:out value="${fn:length(lifeEvents)}" /> <%-- size of liveEvents --%>

确保在页面顶部添加了以下标记库,以允许使用fn命名空间

<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>