You first have to put an instance of your bean in the Velocity context
with something like:

        context.put("jack",new Person());

and then use this instance in your templates:

        #set($jack.name = "Jack")
        Hello, $jack

Gaining access to the Velocity context depends upon your architecture
(standalone Java application, specific framework like Spring or Struts,
VelocityTools, ...).


  Claude

Le mercredi 16 janvier 2008 à 18:13 -0800, AngeloChen960 a écrit :
> Hi,
> 
> i have this template: hi $name
> and have a entity bean:
> public class Person {
>     private String name;
>       public String getName() { return name; }
>     public void setName(String name) { this.name = name;}
> }
> 
> how to use an instance of Person? Thanks,
> 
> A.C.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to