velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Joelly <chris.joe...@unycom.com>
Subject interpolation of variables ...
Date Tue, 13 Jan 2004 17:34:21 GMT
Hello!

i'm new to velocity and run into the following problem:

i set some data into the context from within my action class:

context.put("field-23", "data23");
context.put("field-24", "data24");
....

then in the velocity template i wanna do something like:

#foreach ( $df in $datafields )
	#set ( $fieldname = "field-$df.getFieldId()" )
	#set ( $fieldvalue = "${$fieldname}" )
	<input type="text" name="$feldname" value="$fieldvalue"/>	
#foreach

i wanna set a variable name dynamically and then lookup the context for
the value of this variable...

is this possible with velocity? if so, can anybody tell me how to do?

thx, Chris

-- 
mit freundlichen Grüßen / with kind regards
 
Ing. Christian Jölly @ Solutions
unycom  Information Technology Services GmbH
A-8042 Graz | Schmiedlstraße 1 / III

Tel: ++43 (0)316 / 818 828 - 30
Fax: ++43 (0)316 / 818 828 - 38
chris.joelly@unycom.com
http://www.unycom.com

Polizist: "In ihrem Zustand heißt die Devise: Hände weg vom Steuer!"
Betrunkner Autofahrer: "Was, wenn ich blau bin soll ich auch noch
freihändig fahren?" 

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


Mime
View raw message