• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using JSTL and c:forEach to iter thru nested Collection data structures, troubles...

Rj Kattke
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I've actually got is a HashMap<Integer, ArrayList<String>>

after adding the HashMap to the pageContext with pageContext.setAttribute(k, v);
I can do the following, and it works pretty well
<c:forEach var="row" items="${myMap}">

<cut value="${row.value}"/>


But I can't seem to do anything else with the ArrayList, such as

<cut value="${row}.get(1)"/>

maybe I've got the syntax wrong ??
If I can't use the (ArrayList) API here, I'm just curious.... Can I assign the value of "${row}" to a local variable,
and use it in a scriplet ? Does ${row} become a pageContext variable at this point ? and can it be accessed and used ?

-I can, recursively use it again, like this
<c:forEach var="col" items="${row.value}">

working on it, but would appreciate others relevant ideas
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic