示例#1
1
 @Bean
 public SpringResourceTemplateResolver templateResolver() {
   SpringResourceTemplateResolver r = new SpringResourceTemplateResolver();
   r.setPrefix("src/main/resources/templates");
   r.setSuffix(".html");
   r.setTemplateMode("LEGACYHTML5");
   r.setCacheable(false);
   return r;
 }
 private SpringResourceTemplateResolver templateResolver() {
   SpringResourceTemplateResolver resolver = new SpringResourceTemplateResolver();
   resolver.setPrefix("classpath:/views/");
   resolver.setSuffix(".html");
   resolver.setTemplateMode(TemplateMode.HTML);
   resolver.setApplicationContext(applicationContext);
   return resolver;
 }