0

My java class is returning the values like List>>. In JSTL, How do I print the LinkedHashMap Key and List .

<c:forEach var="row" items="${myList.data}"> // Main List
    <DIV>
       <span option="1">${row.key}</span> // Getting empty key
    </DIV>

</c:forEach>
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
RKCY
  • 4,095
  • 14
  • 61
  • 97

1 Answers1

1
what is .data if it is list ? I think .data will not come.Your loop should be like this

<c:forEach items="${myList}" var="map"> 
<c:forEach var="entry" items="${map}">
<tr><td><c:out value="${entry.key}"/></td> <td><c:out value="${entry.value}"/> </td></tr>
</c:forEach>
</c:forEach>
vivekdubey
  • 484
  • 2
  • 7