• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

html:iterator troubles

 
Terry Courtney
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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">

</logic:iterate>

* 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
Posts: 336
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try returning the collection itself in your getAllComplaints() method and not the iterator for the collection.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic