How to iterate HashMap in JSF using jstl tags
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   skumarweb_web
Posted On:   Wednesday, May 7, 2008 08:55 AM

hi,



I have a HashMap. And i have to iterate in jsp using jstl tags.
i have tried this one with but its not coming. can any one give me suggestion please.



Thanks in Advance
skumar.

Re: How to iterate HashMap in JSF using jstl tags

Posted By:   Anonymous  
Posted On:   Friday, July 25, 2008 09:15 AM

Create a property returning a list of your HashMap.values() on you bean. Then build the table using that property.


public class MyClass {
Map myHashMap = ....

....

public List getMyHashMapValues() {
return new ArrayList(myHashMap.values());
}
}

---------------

Re: How to iterate HashMap in JSF using jstl tags

Posted By:   Star_Plus  
Posted On:   Thursday, May 8, 2008 08:08 PM

If you want to use jstl tags, you can use of core jstl tags. But it needs a collection of objects not a HashMap for it's 'items'.



Not sure whether this suggesion will help you though... anyway have a look at the jstl tags if you want...



http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/index.html
About | Sitemap | Contact