velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ravikanth.L" <>
Subject constructing variable names dynamically
Date Wed, 25 Aug 2004 10:01:06 GMT

 I am new to this velocity framework. I have a
scenario where in i should be able to dynamically
create a variable name used in template.


 I have a arraylist of elements in $elements

 #foreach( $item in $elements )
   //need to create a variable with the value given by
getElementName() and assign the value
   #set($elementName = $item.getElementName())
   #set($$elementName = $item.getValue())

i.e if my elmementName is "Name" i would like to
create a variable name as $Name and assign the value
to this variable and use in the template.

Any suggestions are welcome

With Regards,

Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.

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

View raw message