Meaningless Drivel is fun!
The moose likes Struts and the fly likes html:iterator troubles Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "html:iterator troubles" Watch "html:iterator troubles" New topic

html:iterator troubles

Terry Courtney

Joined: Jul 21, 2006
Posts: 1
I've extended HashMap and added a method which returns the HashMap values in a in a html:iterator friendly format. I've tried returning the values as an Array, Iterator, and Collection. However, my code always returns "No Collection Found". What am I doing wrong?

public class Complaints extends HashMap
public java.util.Iterator getAllComplaints() {
return this.values().iterator();


<logic:iterate id="complaint" name="complaints" property="allComplaints">


* If I remove the property parameter, the loop will work but I need would need to use the 'key' and 'value' properties.
Zip Ped
Ranch Hand

Joined: Jul 26, 2005
Posts: 336
Try returning the collection itself in your getAllComplaints() method and not the iterator for the collection.
I agree. Here's the link:
subject: html:iterator troubles
It's not a secret anymore!