velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Foth, Oliver" <Oliver.F...@gedas.de>
Subject variable display problem
Date Mon, 14 Oct 2002 07:36:14 GMT
Hi everybody,

I have the following problem, or better: challenge ;-)
In a java file I've created some variables within an for loop:

for (i = 0, i < something.length(), i++)
{
   ...
   context.put("aufdat_"+i, aufdat);
   ...
}

I can use them in the vm file and they are displayed correctly. But instead
of using them like:

$aufdat_1<BR/>
$aufdat_2<BR/>
...

I need to use them in another loop:

#set ($index = 0)
#foreach ($thing in $something)
   #set ($index = $index + 1)
   $aufdat_$index
#end

How can I have "$aufdat_$index" displayed correctly?


		Gruß,

		Oliver Foth
> 	----------------------------------------------------
> 	gedas deutschland GmbH
> 	Teilelogistik
> 	Johann-Siegmund-Schuckert-Str. 2a
> 	D-34225 Baunatal
> 	Telefon/phone	+49-561-49995-34
> 	Telefax/telefax	+49-561-49995-52
> 	Mailto: Oliver.Foth@gedas.de
> 	http://www.gedas.com <http://www.gedas.com> 
> 	----------------------------------------------------
> 
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message