@ Bean public ViewResolver viewResolver ( ) { FreeMarkerViewResolver resolver = new FreeMarkerViewResolver ( ) ; resolver . setCache ( true ) ; resolver . setSuffix ( ".ftl" ) ; resolver . setContentType ( "text/html;charset=UTF-8" ) ; return resolver ; }
Enable spring freemarker viewresolver . All freemarker template names should end with . ftl