Is there a syntax that specifies whether some template parameters are mandatory?
If I call this template:
Hello ${name}
While name is undefined, it renders as Hello. I can add explicit checks
#{ifnot name}
!!! ERROR ERROR - missing name !!!
#{/if}
But I’m interested whether there is some built in syntax for this validation?
Not in the Groovy template engine. This was one of the requirements of Play 2.0. See the extract below from the 2.0 announcement.
I know that null values could be caught at runtime, but this is the nature of the dynamic language. You could try the Scala template engine, which is the basis for Play 2.0, but I am not sure how different they are from 1.x and 2.x.