samskivert / jmustache

A Java implementation of the Mustache templating language.
Other
834 stars 128 forks source link

how to set missingIsNull to be true??? #97

Closed skcks closed 6 years ago

skcks commented 6 years ago

as title say.....

samskivert commented 6 years ago

It's a little weird, but if you just want missing values to return null, you can use:

Mustache.compiler().defaultValue(null)

to get a compiler that will return null for missing values. The default value is also used when a value resolves to null, but in this case since the default value is also null, it's not actually changing anything for that case.