• Post Reply Bookmark Topic Watch Topic
  • New Topic

iterating over a HashMap containing ArrayList as value  RSS feed

 
Mohd Asim
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a HashMap hm which has:

hm.put("studId", sid);
hm.put("studName",sn);
hm.put("course", cr);
hm.put("address", addr);
hm.put("phone",ph);
hm.put("dob", dob);

where the values like sid,sn,cr,addr,ph,dob are in turn arraylists.
Now i have this hashmap set in session scope and forwarded to a jsp. the jsp uses jstl to display the contents. I am unable to iterate over it. any solution
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post the code that you say does not work.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66152
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mohd Asim:
I am unable to iterate over it.
Why not? You havn't said what issues you are encountering. What code have you written so far? What happened when you tried to run it?
 
paritosh ranjan
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes,everything you wrote seems correct.This should work.I think you should write the code here which iterates over these lists.
And a gentle reminder,make sure you have populated the lists before iterating
[ October 15, 2007: Message edited by: paritosh ranjan ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!