| Author |
HashMap in taglib
|
saumil baxi
Ranch Hand
Joined: Apr 18, 2008
Posts: 58
|
|
Hi, How can i iterate my hashmap using taglib. Thanks, Saumil
|
 |
sudipto shekhar
Ranch Hand
Joined: Apr 02, 2008
Posts: 813
|
|
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 ]
|
Regards, Sud.
SCJP 5 ScjpFAQ JLS
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56529
|
|
|
What taglib? If you are talking about the JSTL, the <c:forEach> action is what you want.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
sudipto shekhar
Ranch Hand
Joined: Apr 02, 2008
Posts: 813
|
|
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
Joined: Nov 21, 2008
Posts: 11
|
|
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
Joined: Apr 18, 2008
Posts: 58
|
|
|
Thanks..
|
 |
 |
|
|
subject: HashMap in taglib
|
|
|