How to get a value of an object's property when the property name is a variable itself in JSP? [duplicate]
HI,
Here's my dilemma. The below code is obviously wrong but it give you the idea on what I need to accomplish.
<c:forEach var="object1" items="${model.listofObjects1}"&开发者_如何学运维gt;
<tr>
<c:forEach var="object2" items="${model.listofObjects2}">
<td>${object1.${object2}}</td>
</c:forEach>
</tr>
</c:forEach>
Any ideas on how to make this look up?
Use the brace notation.
<td>${object1[object2]}</td>
精彩评论