Java Code Examples for org.thymeleaf.spring4.view.ThymeleafViewResolver

The following are top voted examples for showing how to use org.thymeleaf.spring4.view.ThymeleafViewResolver. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: https-github.com-g0t4-jenkins2-course-spring-boot   File: AbstractThymeleafViewResolverConfiguration.java   View source code 6 votes vote down vote up
@Bean
@ConditionalOnMissingBean(name = "thymeleafViewResolver")
@ConditionalOnProperty(name = "spring.thymeleaf.enabled", matchIfMissing = true)
public ThymeleafViewResolver thymeleafViewResolver() {
	ThymeleafViewResolver resolver = new ThymeleafViewResolver();
	configureTemplateEngine(resolver, this.templateEngine);
	resolver.setCharacterEncoding(this.properties.getEncoding().name());
	resolver.setContentType(appendCharset(this.properties.getContentType(),
			resolver.getCharacterEncoding()));
	resolver.setExcludedViewNames(this.properties.getExcludedViewNames());
	resolver.setViewNames(this.properties.getViewNames());
	// This resolver acts as a fallback resolver (e.g. like a
	// InternalResourceViewResolver) so it needs to have low precedence
	resolver.setOrder(Ordered.LOWEST_PRECEDENCE - 5);
	resolver.setCache(this.properties.isCache());
	return resolver;
}
 
Example 2
Project: https-github.com-g0t4-jenkins2-course-spring-boot   File: ThymeleafAutoConfigurationTests.java   View source code 6 votes vote down vote up
@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();
	this.context.getBean(TemplateEngine.class).initialize();
	ITemplateResolver resolver = this.context.getBean(ITemplateResolver.class);
	assertThat(resolver instanceof TemplateResolver).isTrue();
	assertThat(((TemplateResolver) 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");
}
 
Example 3
Project: https-github.com-g0t4-jenkins2-course-spring-boot   File: ThymeleafAutoConfigurationTests.java   View source code 6 votes vote down vote up
@Test
public void createLayoutFromConfigClass() throws Exception {
	AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
	context.register(ThymeleafAutoConfiguration.class,
			PropertyPlaceholderAutoConfiguration.class);
	MockServletContext servletContext = new MockServletContext();
	context.setServletContext(servletContext);
	context.refresh();
	ThymeleafView view = (ThymeleafView) context.getBean(ThymeleafViewResolver.class)
			.resolveViewName("view", Locale.UK);
	MockHttpServletResponse response = new MockHttpServletResponse();
	MockHttpServletRequest request = new MockHttpServletRequest();
	request.setAttribute(RequestContext.WEB_APPLICATION_CONTEXT_ATTRIBUTE, context);
	view.render(Collections.singletonMap("foo", "bar"), request, response);
	String result = response.getContentAsString();
	assertThat(result).contains("<title>Content</title>");
	assertThat(result).contains("<span>bar</span>");
	context.close();
}
 
Example 4
Project: spring-boot-concourse   File: ThymeleafAutoConfiguration.java   View source code 6 votes vote down vote up
@Bean
@ConditionalOnMissingBean(name = "thymeleafViewResolver")
@ConditionalOnProperty(name = "spring.thymeleaf.enabled", matchIfMissing = true)
public ThymeleafViewResolver thymeleafViewResolver() {
	ThymeleafViewResolver resolver = new ThymeleafViewResolver();
	resolver.setTemplateEngine(this.templateEngine);
	resolver.setCharacterEncoding(this.properties.getEncoding().name());
	resolver.setContentType(appendCharset(this.properties.getContentType(),
			resolver.getCharacterEncoding()));
	resolver.setExcludedViewNames(this.properties.getExcludedViewNames());
	resolver.setViewNames(this.properties.getViewNames());
	// This resolver acts as a fallback resolver (e.g. like a
	// InternalResourceViewResolver) so it needs to have low precedence
	resolver.setOrder(Ordered.LOWEST_PRECEDENCE - 5);
	resolver.setCache(this.properties.isCache());
	return resolver;
}
 
Example 5
Project: spring-boot-concourse   File: DeviceDelegatingViewResolverAutoConfigurationTests.java   View source code 6 votes vote down vote up
@Test
public void deviceDelegatingThymeleafViewResolverEnabled() throws Exception {
	this.context = new AnnotationConfigEmbeddedWebApplicationContext();
	EnvironmentTestUtils.addEnvironment(this.context,
			"spring.mobile.devicedelegatingviewresolver.enabled:true");
	this.context.register(Config.class, WebMvcAutoConfiguration.class,
			ThymeleafAutoConfiguration.class,
			HttpMessageConvertersAutoConfiguration.class,
			PropertyPlaceholderAutoConfiguration.class,
			DeviceDelegatingViewResolverConfiguration.class);
	this.context.refresh();
	ThymeleafViewResolver thymeleafViewResolver = this.context
			.getBean(ThymeleafViewResolver.class);
	AbstractDeviceDelegatingViewResolver deviceDelegatingViewResolver = this.context
			.getBean("deviceDelegatingViewResolver",
					AbstractDeviceDelegatingViewResolver.class);
	assertThat(thymeleafViewResolver).isNotNull();
	assertThat(deviceDelegatingViewResolver).isNotNull();
	assertThat(deviceDelegatingViewResolver.getViewResolver())
			.isInstanceOf(ThymeleafViewResolver.class);
	assertThat(this.context.getBean(InternalResourceViewResolver.class)).isNotNull();
	assertThat(this.context.getBean(ThymeleafViewResolver.class)).isNotNull();
	assertThat(deviceDelegatingViewResolver.getOrder())
			.isEqualTo(thymeleafViewResolver.getOrder() - 1);
}
 
Example 6
Project: spring-boot-concourse   File: DeviceDelegatingViewResolverAutoConfigurationTests.java   View source code 6 votes vote down vote up
@Test(expected = NoSuchBeanDefinitionException.class)
public void deviceDelegatingThymeleafViewResolverDisabled() throws Exception {
	this.context = new AnnotationConfigEmbeddedWebApplicationContext();
	EnvironmentTestUtils.addEnvironment(this.context,
			"spring.mobile.devicedelegatingviewresolver.enabled:false");
	this.context.register(Config.class, WebMvcAutoConfiguration.class,
			ThymeleafAutoConfiguration.class,
			HttpMessageConvertersAutoConfiguration.class,
			PropertyPlaceholderAutoConfiguration.class,
			DeviceDelegatingViewResolverConfiguration.class);
	this.context.refresh();
	assertThat(this.context.getBean(InternalResourceViewResolver.class)).isNotNull();
	assertThat(this.context.getBean(ThymeleafViewResolver.class)).isNotNull();
	this.context.getBean("deviceDelegatingViewResolver",
			AbstractDeviceDelegatingViewResolver.class);
}
 
Example 7
Project: spring-boot-concourse   File: ThymeleafAutoConfigurationTests.java   View source code 6 votes vote down vote up
@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();
	this.context.getBean(TemplateEngine.class).initialize();
	ITemplateResolver resolver = this.context.getBean(ITemplateResolver.class);
	assertThat(resolver instanceof TemplateResolver).isTrue();
	assertThat(((TemplateResolver) 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");
}
 
Example 8
Project: spring-boot-concourse   File: ThymeleafAutoConfigurationTests.java   View source code 6 votes vote down vote up
@Test
public void createLayoutFromConfigClass() throws Exception {
	AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
	context.register(ThymeleafAutoConfiguration.class,
			PropertyPlaceholderAutoConfiguration.class);
	MockServletContext servletContext = new MockServletContext();
	context.setServletContext(servletContext);
	context.refresh();
	ThymeleafView view = (ThymeleafView) context.getBean(ThymeleafViewResolver.class)
			.resolveViewName("view", Locale.UK);
	MockHttpServletResponse response = new MockHttpServletResponse();
	MockHttpServletRequest request = new MockHttpServletRequest();
	request.setAttribute(RequestContext.WEB_APPLICATION_CONTEXT_ATTRIBUTE, context);
	view.render(Collections.singletonMap("foo", "bar"), request, response);
	String result = response.getContentAsString();
	assertThat(result).contains("<title>Content</title>");
	assertThat(result).contains("<span>bar</span>");
	context.close();
}
 
Example 9
Project: contestparser   File: ThymeleafAutoConfiguration.java   View source code 6 votes vote down vote up
@Bean
@ConditionalOnMissingBean(name = "thymeleafViewResolver")
@ConditionalOnProperty(name = "spring.thymeleaf.enabled", matchIfMissing = true)
public ThymeleafViewResolver thymeleafViewResolver() {
	ThymeleafViewResolver resolver = new ThymeleafViewResolver();
	resolver.setTemplateEngine(this.templateEngine);
	resolver.setCharacterEncoding(this.properties.getEncoding().name());
	resolver.setContentType(appendCharset(this.properties.getContentType(),
			resolver.getCharacterEncoding()));
	resolver.setExcludedViewNames(this.properties.getExcludedViewNames());
	resolver.setViewNames(this.properties.getViewNames());
	// This resolver acts as a fallback resolver (e.g. like a
	// InternalResourceViewResolver) so it needs to have low precedence
	resolver.setOrder(Ordered.LOWEST_PRECEDENCE - 5);
	return resolver;
}
 
Example 10
Project: contestparser   File: DeviceDelegatingViewResolverAutoConfigurationTests.java   View source code 6 votes vote down vote up
@Test(expected = NoSuchBeanDefinitionException.class)
public void deviceDelegatingInternalResourceViewResolverDisabled() throws Exception {
	this.context = new AnnotationConfigEmbeddedWebApplicationContext();
	EnvironmentTestUtils.addEnvironment(this.context,
			"spring.mobile.devicedelegatingviewresolver.enabled:false");
	this.context.register(Config.class, WebMvcAutoConfiguration.class,
			HttpMessageConvertersAutoConfiguration.class,
			PropertyPlaceholderAutoConfiguration.class,
			DeviceDelegatingViewResolverConfiguration.class);
	this.context.refresh();
	assertNotNull(this.context.getBean(InternalResourceViewResolver.class));
	try {
		this.context.getBean(ThymeleafViewResolver.class);
	}
	catch (NoSuchBeanDefinitionException ex) {
		// expected. ThymeleafViewResolver shouldn't be defined.
	}
	this.context.getBean("deviceDelegatingViewResolver",
			AbstractDeviceDelegatingViewResolver.class);
}
 
Example 11
Project: contestparser   File: DeviceDelegatingViewResolverAutoConfigurationTests.java   View source code 6 votes vote down vote up
@Test
public void deviceDelegatingThymeleafViewResolverEnabled() throws Exception {
	this.context = new AnnotationConfigEmbeddedWebApplicationContext();
	EnvironmentTestUtils.addEnvironment(this.context,
			"spring.mobile.devicedelegatingviewresolver.enabled:true");
	this.context.register(Config.class, WebMvcAutoConfiguration.class,
			ThymeleafAutoConfiguration.class,
			HttpMessageConvertersAutoConfiguration.class,
			PropertyPlaceholderAutoConfiguration.class,
			DeviceDelegatingViewResolverConfiguration.class);
	this.context.refresh();
	ThymeleafViewResolver thymeleafViewResolver = this.context
			.getBean(ThymeleafViewResolver.class);
	AbstractDeviceDelegatingViewResolver deviceDelegatingViewResolver = this.context
			.getBean("deviceDelegatingViewResolver",
					AbstractDeviceDelegatingViewResolver.class);
	assertNotNull(thymeleafViewResolver);
	assertNotNull(deviceDelegatingViewResolver);
	assertTrue(deviceDelegatingViewResolver
			.getViewResolver() instanceof ThymeleafViewResolver);
	assertNotNull(this.context.getBean(InternalResourceViewResolver.class));
	assertNotNull(this.context.getBean(ThymeleafViewResolver.class));
	assertTrue(deviceDelegatingViewResolver
			.getOrder() == thymeleafViewResolver.getOrder() - 1);
}
 
Example 12
Project: contestparser   File: DeviceDelegatingViewResolverAutoConfigurationTests.java   View source code 6 votes vote down vote up
@Test(expected = NoSuchBeanDefinitionException.class)
public void deviceDelegatingThymeleafViewResolverDisabled() throws Exception {
	this.context = new AnnotationConfigEmbeddedWebApplicationContext();
	EnvironmentTestUtils.addEnvironment(this.context,
			"spring.mobile.devicedelegatingviewresolver.enabled:false");
	this.context.register(Config.class, WebMvcAutoConfiguration.class,
			ThymeleafAutoConfiguration.class,
			HttpMessageConvertersAutoConfiguration.class,
			PropertyPlaceholderAutoConfiguration.class,
			DeviceDelegatingViewResolverConfiguration.class);
	this.context.refresh();
	assertNotNull(this.context.getBean(InternalResourceViewResolver.class));
	assertNotNull(this.context.getBean(ThymeleafViewResolver.class));
	this.context.getBean("deviceDelegatingViewResolver",
			AbstractDeviceDelegatingViewResolver.class);
}
 
Example 13
Project: contestparser   File: ThymeleafAutoConfigurationTests.java   View source code 6 votes vote down vote up
@Test
public void createLayoutFromConfigClass() throws Exception {
	AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
	context.register(ThymeleafAutoConfiguration.class,
			PropertyPlaceholderAutoConfiguration.class);
	MockServletContext servletContext = new MockServletContext();
	context.setServletContext(servletContext);
	context.refresh();
	ThymeleafView view = (ThymeleafView) context.getBean(ThymeleafViewResolver.class)
			.resolveViewName("view", Locale.UK);
	MockHttpServletResponse response = new MockHttpServletResponse();
	MockHttpServletRequest request = new MockHttpServletRequest();
	request.setAttribute(RequestContext.WEB_APPLICATION_CONTEXT_ATTRIBUTE, context);
	view.render(Collections.singletonMap("foo", "bar"), request, response);
	String result = response.getContentAsString();
	assertTrue("Wrong result: " + result, result.contains("<title>Content</title>"));
	assertTrue("Wrong result: " + result, result.contains("<span>bar</span>"));
	context.close();
}
 
Example 14
Project: scrumtracker2017   File: ThymeleafConfig.java   View source code 5 votes vote down vote up
@Bean
public ThymeleafViewResolver thymeleafViewResolver()
{
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine());
    resolver.setOrder(1);
    resolver.setCharacterEncoding("UTF-8");
    return resolver;
}
 
Example 15
Project: ToDoApp-Spring   File: ThymeleafConfig.java   View source code 5 votes vote down vote up
@Bean
public ViewResolver viewResolver() {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine());
    resolver.setCharacterEncoding("UTF-8");
    resolver.setOrder(1);
    return resolver;
}
 
Example 16
Project: custom-gradle-plugin-portal   File: ResourceConfig.java   View source code 5 votes vote down vote up
@Bean
public ViewResolver viewResolver() {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine());
    resolver.setCharacterEncoding("UTF-8");
    return resolver;
}
 
Example 17
Project: Sound.je   File: TemplateConfig.java   View source code 5 votes vote down vote up
/**
 * Bean to configure thymeleaf view resolver
 *
 * @return the thymeleaf view resolver
 */
@Bean(name = "viewResolver")
public ThymeleafViewResolver getViewResolver() {
    final ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
    viewResolver.setTemplateEngine(getTemplateEngine());
    return viewResolver;
}
 
Example 18
Project: Spring-Security-Third-Edition   File: ThymeleafConfig.java   View source code 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ViewResolver viewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example 19
Project: Spring-Security-Third-Edition   File: ThymeleafConfig.java   View source code 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ViewResolver viewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example 20
Project: Spring-Security-Third-Edition   File: ThymeleafConfig.java   View source code 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ViewResolver viewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example 21
Project: Spring-Security-Third-Edition   File: ThymeleafConfig.java   View source code 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ViewResolver viewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example 22
Project: Spring-Security-Third-Edition   File: ThymeleafConfig.java   View source code 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ViewResolver viewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example 23
Project: Spring-Security-Third-Edition   File: ThymeleafConfig.java   View source code 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ViewResolver viewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example 24
Project: Spring-Security-Third-Edition   File: ThymeleafConfig.java   View source code 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ViewResolver viewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example 25
Project: Spring-Security-Third-Edition   File: ThymeleafConfig.java   View source code 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ViewResolver viewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example 26
Project: Spring-Security-Third-Edition   File: ThymeleafConfig.java   View source code 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ViewResolver viewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example 27
Project: Spring-Security-Third-Edition   File: ThymeleafConfig.java   View source code 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ViewResolver viewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example 28
Project: Spring-Security-Third-Edition   File: ThymeleafConfig.java   View source code 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ViewResolver viewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example 29
Project: Spring-Security-Third-Edition   File: ThymeleafConfig.java   View source code 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ViewResolver viewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example 30
Project: Spring-Security-Third-Edition   File: ThymeleafConfig.java   View source code 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ViewResolver viewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example 31
Project: Spring-Security-Third-Edition   File: ThymeleafConfig.java   View source code 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ViewResolver viewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example 32
Project: Spring-Security-Third-Edition   File: ThymeleafConfig.java   View source code 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ViewResolver viewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example 33
Project: Spring-Security-Third-Edition   File: ThymeleafConfig.java   View source code 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ViewResolver viewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example 34
Project: Spring-Security-Third-Edition   File: ThymeleafConfig.java   View source code 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ThymeleafViewResolver thymeleafViewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example 35
Project: Spring-Security-Third-Edition   File: ThymeleafConfig.java   View source code 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ThymeleafViewResolver thymeleafViewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example 36
Project: Spring-Security-Third-Edition   File: ThymeleafConfig.java   View source code 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ThymeleafViewResolver thymeleafViewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example 37
Project: Spring-Security-Third-Edition   File: ThymeleafConfig.java   View source code 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ThymeleafViewResolver thymeleafViewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example 38
Project: Spring-Security-Third-Edition   File: ThymeleafConfig.java   View source code 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ThymeleafViewResolver thymeleafViewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example 39
Project: Spring-Security-Third-Edition   File: ThymeleafConfig.java   View source code 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ThymeleafViewResolver thymeleafViewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}
 
Example 40
Project: Spring-Security-Third-Edition   File: ThymeleafConfig.java   View source code 5 votes vote down vote up
@Bean
@Description("Thymeleaf view resolver")
public ThymeleafViewResolver thymeleafViewResolver(final SpringTemplateEngine templateEngine) {
    ThymeleafViewResolver resolver = new ThymeleafViewResolver();
    resolver.setTemplateEngine(templateEngine);
    resolver.setCharacterEncoding("UTF-8");
    resolver.setCache(false);
    resolver.setOrder(1);
    return resolver;
}