Velocity just print the tag name if no value was found in VelocityContext, ie, $name in my template file, but there is no value for \"name\" in VelocityContext, so just \"$n
Create a velocimacro in your template:
#macro(defaultValue $parm) #if (!$!parm || $!parm == "") i-like-will #else $parm #end #end
And call it like this in the same template:
#defaultValue($name)
Check Apache Velocity - Velocity User Guide for more info on velocimacros (and velocity in general).