在velocity中,我有一个变量,其值为null。在这种情况下,我不想显示任何内容。
目前,模板引擎将""翻译成null,因此我必须这样做。
有没有直接做到这一点的方法?我想能够制作出这样的东西:
目前,模板引擎将""翻译成null,因此我必须这样做。
#set ( $a = "")
#if ($a)
assert("never prints a neither gets here: " + $a)
#end
有没有直接做到这一点的方法?我想能够制作出这样的东西:
This is the variable $a. ## in case that $a is null i don't want 'dollar a' to be displayed