| Author |
using c:forEach to iterate over Map<String, ArrayList<Hashmap>>
|
praveen prabhakaran
Greenhorn
Joined: Sep 18, 2009
Posts: 3
|
|
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
Joined: Feb 23, 2009
Posts: 1183
|
|
|
|
JDBCSupport - An easy to use, light-weight JDBC framework -
|
 |
praveen prabhakaran
Greenhorn
Joined: Sep 18, 2009
Posts: 3
|
|
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
Joined: Feb 23, 2009
Posts: 1183
|
|
First, please put your code between code tags.
What is the pound sign doing there ?
|
 |
praveen prabhakaran
Greenhorn
Joined: Sep 18, 2009
Posts: 3
|
|
|
its a part of jsf code. i have getters and setters for the property providerMap
|
 |
Sebastian Janisch
Ranch Hand
Joined: Feb 23, 2009
Posts: 1183
|
|
|
Are you sure the first iteration block runs ? If yes, what is the output ? Any error messages ?
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56204
|
|
|
Moved to the JSF forum.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Sebastian Janisch
Ranch Hand
Joined: Feb 23, 2009
Posts: 1183
|
|
Bear Bibeault wrote:Moved to the JSF forum.
It's not really JSF related ... Why moving it ?
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56204
|
|
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.
|
 |
 |
|
|
subject: using c:forEach to iterate over Map<String, ArrayList<Hashmap>>
|
|
|