velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject A Dynamic ArrayList Literal?
Date Wed, 14 Jul 2004 21:12:52 GMT
I would like to store an ArrayList literal in a Velocity variable and then
use the stored ArrayList literal to establish a new ArrayList (and its 
e.g. I'd like to do something like:

#set($names = '["Bill","Harry","Chris","Sue"]')

#set($namesArrayList = $names)
#foreach($name in $namesArrayList)

However, the above VTL results in $namesArrayList
being a variable (not an ArrayList) and hence the
foreach directive effectively does nothing.

Is there a way to do what I am attempting here?
In the second #set directive, I want $names to be
evaluated (substitution occurs) before the assignment
takes place.



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

View raw message