1

In Freemarker you can

<p>${my_var!}</p>

to avoid having an error message if my_var is not defined, and

<p>${my_var!"this is undefined!"}</p>

to set a defaut value for my_var if it is not defined.

What with Velocity? Do you also have a compact syntaxe or do you have to do a if/else statement?

Julien
  • 2,616
  • 1
  • 30
  • 43

1 Answers1

0

Found an answer here : Velocity nulls and empty strings

solution with velocity :

<p>$!my_var</p>
Community
  • 1
  • 1
Julien
  • 2,616
  • 1
  • 30
  • 43