File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Iterate Hashmap through struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Iterate Hashmap through struts" Watch "Iterate Hashmap through struts" New topic

Iterate Hashmap through struts

pax smith
Ranch Hand

Joined: Dec 13, 2005
Posts: 45

Can anybody give me the sample code to iterate a hashmap in which I have a key and a string in the value field

poornima balagopal
Ranch Hand

Joined: Dec 02, 2003
Posts: 83
You can go through this link
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
<logic:iterate id="element" name="myHashMap">
Key is <bean:write name="element" property="key" />
Value is <bean:write name="element" property="value" />

Consultant, Sima Solutions
Chris Rutkowski

Joined: Jun 26, 2006
Posts: 8
What if the HashMap was contained in an ArrayList? How would you iterate through the ArrayList, and then iterate through each HashMap inside it?

What's wrong with this code?
madhus mukthas

Joined: Oct 24, 2009
Posts: 2
Not able to get your logic. Instead i am posting a working code below

Don't get me started about those stupid light bulbs.
subject: Iterate Hashmap through struts
It's not a secret anymore!