velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barbara Baughman <>
Subject Defining iterator for #foreach
Date Mon, 18 Oct 2004 16:43:49 GMT
It looks like, for the first time, I am passing an object to a foreach
loop that that is not a Vector, HashMap, or Array.

I instead have a class that essentially wraps a Vector of a certain
type.  It includes a method:

public Iterator iterator() {
   return v.iterator(); // return iterator of the underlying Vector

I thought all classes with iterators would work with a #foreach loop
(even though I don't see that in the documentation.  However, I get
the error message:

Mon Oct 18 11:22:49 CDT 2004   [warn] Could not determine type of
iterator in #foreach loop  at [0,0] in template member/info/facstaff.vm

The template output only provides one blank line, even though the
size() method indicates there are 84 members.

Any hints or tips?

Barbara Baughman

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message