This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes JSP and the fly likes HashMap in taglib Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "HashMap in taglib" Watch "HashMap in taglib" New topic
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: 823

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: 63232
    
  69

What taglib? If you are talking about the JSTL, the <c:forEach> action is what you want.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 823




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..
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: HashMap in taglib
 
It's not a secret anymore!