This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "html:iterator troubles" Watch "html:iterator troubles" New topic
Author

html:iterator troubles

Terry Courtney
Greenhorn

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">

</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

Joined: Jul 26, 2005
Posts: 336
Try returning the collection itself in your getAllComplaints() method and not the iterator for the collection.
 
wood burning stoves
 
subject: html:iterator troubles