[英]How to get JSTL Tag like ${Some} in jsp page but Some is not a value
[英]How can I get the value of element which inside of an Arralyst in my JSP with JSTL tag?
我想获取ArrayList内每个元素的值,该元素已作为request.setAttribute传递给JSP。
当我编写下一个代码时,我可以通过ArraList获得每个元素的值:
<table border="1">
<c:forEach var="item" items="${ListCompanies}">
<td><b><c:out value="${item.string2}"/></b></td>
<td><b><c:out value="${item.string3}"/></b></td>
</c:forEach>
</table>
但是,我不知道如何在没有foreach操作的情况下直接获得价值
像这样:
<c:out value="${ListCompanies.string2}"/>
有人可以告诉我如何管理c:out以从元素中获取价值吗?
就像是
<c:out value="${ListCompanies[0].string2}" />
要么
<c:out value="${ListCompanies[1].string3}" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.