velocity-user mailing list archives

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

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
$user.getFirstname(),
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
#end

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
martin.mooslechner@siemens.at


--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message