velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <...@xyris.com>
Subject RE: automatic context filling ??
Date Tue, 06 Feb 2001 17:28:13 GMT
Huh?

More inline...

> -----Original Message-----
> From: Thomas Fahrmeyer [mailto:thomas.fahrmeyer@einsurance.de]
> Sent: Tuesday, February 06, 2001 10:42 AM
> To: Velocity-User
> Subject: automatic context filling ??
> 
> 
> Hi,
> 
> is there a way to do the following:
> 	UtilityClass.fillContext(context, "user.name", "scott");

In Java?  Why not just set your objects *before* putting them into the
context?

If I am reading this right, it sounds like an application design issue more
than a deficiency in the Velocity toolset.

Can you explain this again if I didn't get it?

geir

> 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