Hello,
I am a newbie to Velocity trying with a very simple code:
Velocity.init();
VelocityContext context = new VelocityContext();
context.put(name, velocity);
String s = We are using $project $name to render this.;
w = new StringWriter();
Velocity.evaluate( context, w, mystring, s );
The
#if ($project)
The project is $project.
#else
There is no project.
#end
This lets you control the output depending on whether there is a value
for the context object project. If you simply want to suppress
output when there is no object, use the silent notation.
$!project
(adds nothing to the
Hi Barbara,
Thanks for you reply. The code snippet you sent would work fine if the check
is done inside the template, however assume if this is not done inside the
template.
Is it still possible to find the list of all the variables for which there
wasn't any values provided in the context