velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <>
Subject Re: foreach in reverse?
Date Thu, 20 Mar 2003 15:30:13 GMT
On Thu, 2003-03-20 at 10:22, Mark Becker wrote:
> I need some help with a Velocity foreach problem.  Or it might be 
> a Java Hashtable/Set problem

It's not a problem, it's just that hashing doesn't preserve order. In
fact in some of the java hash classes the order doesn't even have to
remain constant.

It you want to retain ordering you should use a List collection or
something similar, if you're dead-set on using a key->value you could
use a TreeMap which guarantees ascending key order.


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

View raw message