• Post Reply Bookmark Topic Watch Topic
  • New Topic

using c:forEach to iterate over Map<String, ArrayList<Hashmap>>

 
praveen prabhakaran
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I have some data in the structure Map<String, ArrayList<Hashmap>>.
how can I iterate over the above structure using c:forEach?
Or is there any other way to iterate such data structure?

Regards,
Praveen
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
praveen prabhakaran
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hii
I wrote like, but its not working.
<c:forEach var="pmap" items="#{RfpCommunicateToProviders.providerMap}">
<c:forEach var="list" items="${pmap.value}">
<c:forEach var="plist" items="list">
${plist.email}
</c:forEach>
</c:forEach>
</c:forEach>


email is the key for the map element residing in the ArrayList
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, please put your code between code tags.

What is the pound sign doing there ?
 
praveen prabhakaran
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its a part of jsf code. i have getters and setters for the property providerMap
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure the first iteration block runs ? If yes, what is the output ? Any error messages ?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65522
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the JSF forum.
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Moved to the JSF forum.


It's not really JSF related ... Why moving it ?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65522
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If there's JSF in the code, it gets moved. Otherwise, we waste time with questions like "what's that # doing there?".

JSF acts very differently than JSP in may respects and there are usually nuances that will not be known to people in the JSP forum who are not familiar with JSF.

So in order to avoid confusing people who are not using JSF, and in an effort to get questions answered more quickly, any question for apps that use JSF get moved from JSP to JSF.

P.S. In the future please PM me with such question rather than posting publicly.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!