• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
praveen prabhakaran
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you sure the first iteration block runs ? If yes, what is the output ? Any error messages ?
 
Sheriff
Posts: 67748
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moved to the JSF forum.
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Moved to the JSF forum.



It's not really JSF related ... Why moving it ?
 
Bear Bibeault
Sheriff
Posts: 67748
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic