velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Fahrmeyer" <thomas.fahrme...@einsurance.de>
Subject automatic context filling ??
Date Tue, 06 Feb 2001 15:41:41 GMT
Hi,

is there a way to do the following:
	UtilityClass.fillContext(context, "user.name", "scott");

It should do: Look in the given context for a object named "user", then call
setName("scott")
That would be very cool. I wanna use it to pre-fill a form. I want to create
a context and put all the
inital objects like "user" into that context. Then validate the form data.
If the form is invalid I would like to do:
	String value = request.getParameter("user.name") // because all the form
elements are named like the
									 // Velocity context objects
	UtilityClass.fillContext(context, "user.name", value);

Then I use this context to display the data in the template.

I know you are confused once again ;), but I think you can imagine what I
wanna have.

How can I achieve that, which classes are involved. Can I customize Velocity
behavior.

bye
Thomas

      (O) (O)
----^^^  °  ^^^--------------------------
Das was wir haben, können wir verlieren
durch den masslosen Wunsch nach mehr.
-----------------------------------------



Mime
View raw message