• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

html:iterator troubles

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try returning the collection itself in your getAllComplaints() method and not the iterator for the collection.
 
reply
    Bookmark Topic Watch Topic
  • New Topic