I am working on JSP and stuck in this error "Unterminated <c:forEach tag "
This is relevant part from contentStatis.jsp
<tbody>
<br><c:forEach var="contentStatis" items="${resultcount}" >
<td align="center"><c:out value="${contentStatis.dtm}" /></td>
<td align="center"><c:out value="${contentStatis.StudentPkg}" /></td>
<td align="center"><c:out value="${contentStatis.Shared}" /></td>
<td align="center"><c:out value="${contentStatis.NonShared}" /></td>
</tbody>
This is the relevant part from Controller.java
List<ContentStatis> result = ContentStatisRepository.statis(maps);
List<ContentStatis> resultcount = ContentStatisRepository.mnote(maps);
Pagination<ContentStatis> resultList = PaginationUtil.getPaginationList(result, condition, (long)result.size(), Order.DESC);
model.addAttribute("result", result);
model.addAttribute("condition", condition);
model.addAttribute("resultList", resultList);
model.addAttribute("resultcount", resultcount);
}
return "admin/statisMng/contentStatis";
And this is relevant part from the Repository.java
@Statement(id="ContentStatis.mnote")
public List<ContentStatis> mnote(Map<String, Object> maps);
Does anyone see where the problem is? When I execute the jsp, the error occurs
"/WEB-INF/views/admin/statisMng/contentStatis.jsp(459,0) Unterminated <c:forEach tag"
most jstl tags are block tags so they need to be terminated
either by using <tag/>
or <tag></tag>
<c:forEach var="contentStatis" items="${resultcount}" >
<td align="center"><c:out value="${contentStatis.dtm}" /></td>
<td align="center"><c:out value="${contentStatis.StudentPkg}" /></td>
<td align="center"><c:out value="${contentStatis.Shared}" /></td>
<td align="center"><c:out value="${contentStatis.NonShared}" /></td>
</c:forEach> <!-- you are missing this bit -->
你需要</c:forEach>
包装内容
I'm pretty sure your error is telling you exactly what the problem is. This tag isn't terminated
<c:forEach var="contentStatis" items="${resultcount}" >
Somewhere you need to add a
</c:forEach>
You forgot to end the
<c:forEach>
tag, close it with:
</c:forEach>
It's self explanatory:
"/WEB-INF/views/admin/statisMng/contentStatis.jsp(459,0) Unterminated <c:forEach tag"
means you need to close the tag. or "terminate" it.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.