use of org.thymeleaf.spring5.view.ThymeleafViewResolver in project gs-spring-security-3.2 by rwinch.
the class WebMvcConfiguration method viewResolver.
@Bean
public ThymeleafViewResolver viewResolver(SpringTemplateEngine templateEngine) {
ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
viewResolver.setTemplateEngine(templateEngine);
viewResolver.setViewClass(ThymeleafTilesView.class);
viewResolver.setCache(false);
return viewResolver;
}
use of org.thymeleaf.spring5.view.ThymeleafViewResolver in project spring-security by spring-projects.
the class WebMvcConfiguration method viewResolver.
@Bean
public ViewResolver viewResolver() {
ThymeleafViewResolver resolver = new ThymeleafViewResolver();
resolver.setTemplateEngine(templateEngine());
resolver.setCharacterEncoding("UTF-8");
return resolver;
}
use of org.thymeleaf.spring5.view.ThymeleafViewResolver in project spring-boot by spring-projects.
the class ThymeleafAutoConfigurationTests method overrideViewNames.
@Test
public void overrideViewNames() throws Exception {
EnvironmentTestUtils.addEnvironment(this.context, "spring.thymeleaf.viewNames:foo,bar");
this.context.register(ThymeleafAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class);
this.context.refresh();
ThymeleafViewResolver views = this.context.getBean(ThymeleafViewResolver.class);
assertThat(views.getViewNames()).isEqualTo(new String[] { "foo", "bar" });
}
use of org.thymeleaf.spring5.view.ThymeleafViewResolver in project spring-boot by spring-projects.
the class ThymeleafAutoConfigurationTests method overrideCharacterEncoding.
@Test
public void overrideCharacterEncoding() throws Exception {
EnvironmentTestUtils.addEnvironment(this.context, "spring.thymeleaf.encoding:UTF-16");
this.context.register(ThymeleafAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class);
this.context.refresh();
ITemplateResolver resolver = this.context.getBean(ITemplateResolver.class);
assertThat(resolver instanceof SpringResourceTemplateResolver).isTrue();
assertThat(((SpringResourceTemplateResolver) resolver).getCharacterEncoding()).isEqualTo("UTF-16");
ThymeleafViewResolver views = this.context.getBean(ThymeleafViewResolver.class);
assertThat(views.getCharacterEncoding()).isEqualTo("UTF-16");
assertThat(views.getContentType()).isEqualTo("text/html;charset=UTF-16");
}
Aggregations