In velocity I have a variable which its value is null. I don't want to display anything in that case.
Currently the template engine translates "" to null so I have to do.
#set ( $a = "")
#if ($a)
assert("never prints a neither gets here: " + $a)
#end
Is there a way I could do that directly? I'd like to be able to make something like:
This is the variable $a. ## in case that $a is null i don't want 'dollar a' to be displayed
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…