aspose file tools*
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
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: 61603
    
  67

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 agree. Here's the link: http://aspose.com/file-tools
 
subject: HashMap in taglib