velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <>
Subject Re: Getting lines of text individually
Date Wed, 06 Mar 2002 03:47:36 GMT
On 3/5/02 7:24 PM, "Diane Holt" <> wrote:

> Is there any way to say:
> Here are several
> lines of text
> treat them as
> individual items
> in a #foreach.


#set($lines= ["Hello","there","Diane"])

#foreach($line in $lines)

Will output


Now, it's no fun to specify lines of text like this in the Object array
(that's what we call the square bracket thingy...), but you could just as
well put that in anything iterable (List, for example) in your Java code,
and iterate over that as shown..


Geir Magnusson Jr.                           
System and Software Consulting
"He who throws mud only loses ground." - Fat Albert

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

View raw message