velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mooslechner Martin <>
Subject Run-time dynamic read of Properties
Date Tue, 06 Nov 2001 09:21:21 GMT

I have a variabe, say $user, with many properties $user.firstname,
$user.lastname, ...

I know that I can get the values with either $user.firstname or
but is there a possibility to specify the property at runtime? 

something like

#set ( $desired_properties = ["firstname", "lastname", "birthdate"] )

#foreach ($property in $desired_properties)
	The property $property equals: $user.$property

but it doesn't work that way.
Is there a way to achieve this with the formal notation? Is there a #parse
similiar directive where I can not only parse files, but also variables
(would it be possible to put "\$user.$property" in a variable, which will be
parsed then)?

I'd appreciate any suggestions,

thank you, 

Martin Mooslechner

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

View raw message