这一点有多种方式做:
1. 用!来处理
http://freemarker.sourceforge.net/docs/dgui_template_exp.html#dgui_template_exp_missing
2. 在开发环境和生产环境用不同的Error Handler
http://freemarker.sourceforge.net/docs/pgui_config_errorhandling.html
比如生产环境用TemplateExceptionHandler.IGNORE_HANDLER