I have a list of object array like this.
List<Object[]> reqUserDetails = new ArrayList<Object[]>();
Now I have to iterate this list and take values like Object[0],Object[1].... How can I do this using JSTL?
The general syntax is to itearate it like ,
<c:forEach items="${outerList}" var="innerList">
<c:forEach items="${innerList}" var="item">
// Print your object here
</c:forEach>
</c:forEach>
and in your case ,
<c:forEach items="${reqUserDetails}" var="firstVar">
<c:forEach items="${firstVar}" var="secodVar"> // firstVar will hold your object array
<c:out value="${secondVar.field1}" /> // on iterating the object array
</c:forEach>
</c:forEach>
as it contains array of objects
inside the List
. so the outerList will hold the Object[]
which you need to iterate again.
Hope this helps !!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With