views:

39

answers:

1

Hi,

I came to know about null check using $null in velocity 1.6 through a resource updated by you. Resource: http://stackoverflow.com/questions/24495/reading-model-objects-mapped-in-velocity-templates But I am facing so many challenges that there is no $null for null check in velocity as there is no documentation provided about this. Please provide me with documentation stating $null as valid for null check in velocity.

Thanks in Advance lucky

+1  A: 

To check if a variable is not null simply use #if ($variable)

#if ($variable) 
 ... do stuff here if the variable is not null
#end

If you need to do stuff if the variable is null simply negate the test

#if (!$variable)
 ... do stuff here if the variable is null
#end
a_horse_with_no_name