hi,
Can any body tell me how i can call a class in a velocity template.
I am trying to write a template which call a class that allows me to build
a tree.
thankyou
Do you mean :
How to put a new instance of a class in the velocity context from
inside the vtl?
Usually, you put classes in the context using java
(context.put(name,object)), or using toolbox.xml if you rely on the
VelocityTools subproject.
Now, if you really want to load a new instance of a
Noo...
#set($newobject = $foo.class.forName(myclass).newInstance())
is just not a good way of doing this. It's error-prone, hard to read,
may not be supported in future versions of Velocity. Instead, create
an instance of the object and put it into the context before Velocity
is called
Will Glass-Husain [EMAIL PROTECTED] writes:
is just not a good way of doing this. It's error-prone, hard to read,
may not be supported in future versions of Velocity. Instead, create
... will not be supported ...
One of the strengths of Velocity is that we allow the programmer
control on what