velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <>
Subject Re: "Could not determine type of iterator in #foreach loop"
Date Tue, 13 Aug 2002 12:27:10 GMT
On 8/13/02 7:39 AM, "lloyd" <> wrote:

> I have a custom collection class named SparseList that returns a custom
> iterator.  When I try to use it in Velocity, I get this message in the log:
> [warn] Could not determine type of iterator in #foreach loop for
>       $revs at [25,57] in template revenues2.vm
> The iterator is implemented as a private inner class of the collection,
> and an Iterator interface to it is returned to clients.  Do classes that
> implement Iterator to be used by Velocity have to be public?
> I'd test it but don't have to code with me at the moment.  In the
> meantime - in general, are there any rules custom iterators must follow
> in order to work with Velocity?

What that message means is that it couldn't even figure out how to get
something to iterate over.  Do you do  :

   context("revs", thingy.getIterator());


Geir Magnusson Jr. 
Research & Development, Adeptra Inc.

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

View raw message