Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HashMap in taglib

 
saumil baxi
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How can i iterate my hashmap using taglib.

Thanks,
Saumil
 
sudipto shekhar
Ranch Hand
Posts: 823
Chrome Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by saumil baxi:

How can i iterate my hashmap using taglib.

Saumil


Pass the value of the hashmap to the tag handler class and in the tag handler class you write the java code to iterate through the map....
Make sure your tag handler class has the Bean style setter method as that of the attribute name in your tag.

Hope this helps..
[ November 25, 2008: Message edited by: Sudipto Shekhar ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64824
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What taglib? If you are talking about the JSTL, the <c:forEach> action is what you want.
 
sudipto shekhar
Ranch Hand
Posts: 823
Chrome Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



Pass the value of the hashmap to the tag handler class and in the tag handler class you write the java code to iterate through the map....
Make sure your tag handler class has the Bean style setter method as that of the attribute name in your tag.



Can we do it in this way?
 
Mi Ku
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could, but JSTL has a tag that will do it for you already. As Bear metntioned, the <c:forEach> tag.

What exactly are you trying to do?
 
saumil baxi
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic