spring-页面模板配置
一个可用的freemaker配置:
1 ... 2 @Bean 3 public ViewResolver viewResolver() { 4 FreeMarkerViewResolver fr = new FreeMarkerViewResolver(); 5 fr.setViewClass(FreeMarkerView.class); 6 fr.setContentType("text/html;charset=utf-8"); 7 fr.setRequestContextAttribute("request"); 8 fr.setCache(false); 9 fr.setSuffix(".ftl"); 10 return fr; 11 12 } 13 14 @Bean 15 public FreeMarkerConfigurer freeMakerConfigurer(){ 16 FreeMarkerConfigurer fmc = new FreeMarkerConfigurer(); 17 fmc.setDefaultEncoding("UTF-8"); 18 fmc.setTemplateLoaderPath("/WEB-INF/views/ftls/"); 19 return fmc; 20 } 21 ...
freemake中文手册,freemake下载地址,eclipse插件配置,网页获取项目根路径,多个模板解析配置参考1,多个模板配置参考2,其他参考,