我在jsp页面的迭代中有一个foreach值,如图所示
<c:forEach var="lists" items="${lists}" varStatus="theCount">
String val= ${lists.getVal() } ; //this is giving me error
</c:forEach>
答案 0 :(得分:1)
https://www.tutorialspoint.com/jsp/jstl_core_set_tag.htm
<c:forEach var="list" items="${lists}" varStatus="theCount">
<c:set var="val" value="${list.val}"/>
<p>The value is: ${val}.</p>
</c:forEach>