How to handle null
values in Freemarker? I get some exceptions in the template when null
values are present in data.
Starting from freemarker 2.3.7, you can use this syntax :
${(object.attribute)!}
or, if you want display a default text when the attribute is null
:
${(object.attribute)!"default text"}