I know JSP fits this description, but I'm looking for more modern alternatives.
Unfortunately it seems most modern languages and frameworks are dynamically typed, even the ones which are Java-based.
Related question (JSP was the only answer here): Are there any web frameworks for JVM with data binding checked at compilation time?
This is rather old question, but I have an answer, since I've implemented static-mustache library to provide a type-safe template engine based on mustache syntax.
It checks both syntax errors and type-errors (like missing property) at compile-time. It requires zero build configuration as it's a standard annotation processor.
Templates remain pure mustache templates with all type-information extracted from normal Java-class used for rendering.