Although VTL in this user guide is often displayed with newlines and whitespaces, the VTL shown below:
#set( $imperial = ["Munetaka","Koreyasu","Hisakira","Morikune"] )
#foreach( $shogun in $imperial )
$shogun
#end
is equally valid as the following snippet that Geir Magnusson, Jr. posted to the Velocity user mailing list to illustrate a completely unrelated point:
Send me #set($foo=["$10 and ","a pie"])#foreach($a in $foo)$a#end please.
Velocity's behavior is to gobble up excess whitespace. The preceding directive can be written as:
Send me #set( $foo = ["$10 and ","a pie"] )
#foreach( $a in $foo ) $a #end please.
or as:
Send me
#set($foo = ["$10 and ","a pie"])
#foreach ($a in $foo )
$a
#end please.
In each case the output will be the same.