This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes Iterating a HashMap Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Iterating a HashMap" Watch "Iterating a HashMap" New topic

Iterating a HashMap

Khsitiz sharma

Joined: Jun 03, 2008
Posts: 7
hi all

can any one tell me how to iterate over a HashMap which is declared as
Map<Person,Integer> pHashMap=new HashMap<Person,Integer>();
Here Person is an entity and contains Name, address and age attribute.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

JSTL's c:forEach tag can iterate over such a structure.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: Iterating a HashMap
Similar Threads
how to iterate a hashmap with key hashmap
Problem with hash map
Iterating through HashMap of HashMaps
Hash Maps
bad using method get()