velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Assia Aouat" <>
Subject RE: Indirect access to a variable
Date Tue, 24 Aug 2004 13:10:28 GMT
#set ( $foo = "some value" )
	       #set ( $bar = $foo )

-----Original Message-----
From: Gaetan Sheridan [] 
Sent: Tuesday, August 24, 2004 9:11 AM
Subject: Indirect access to a variable
Importance: Low

I am looking for a way to access the value of an Object put in the
Velocity context using a String containing its name:
#set ( $foo = "some value" )
#set ( $bar = "foo" )
How can I use $bar to display "some value"
I tried things like:
and so on... without success.
The idea is to have a macro where both the name of a parameter and its
value can be outputted:
#macro ( m $paramName )
  <input type=text name="$paramName" value="???">
   #m ("foo")
would result in:
  <input type=text name="foo" value="some value">
Thanks for any help.
Gaetan Sheridan

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

View raw message