package basearch.test;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ResourceBundleMessageSource;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.thymeleaf.spring4.SpringTemplateEngine;
import org.thymeleaf.spring4.view.ThymeleafViewResolver;
import org.thymeleaf.templateresolver.ServletContextTemplateResolver;

@Configuration
@EnableWebMvc
@ComponentScan(basePackages={"basearch.controller"})
public class MvcConfig {

	private static String[] messageSourceBasenames = { "applicationResources" };

	@Bean
	public ResourceBundleMessageSource messageSource() {
		ResourceBundleMessageSource ms = new ResourceBundleMessageSource();
		ms.setBasenames(messageSourceBasenames);
		ms.setFallbackToSystemLocale(false);
		return ms;
	}

	@Bean
	public ServletContextTemplateResolver templateResolver() {
		ServletContextTemplateResolver resolver = new ServletContextTemplateResolver();
		resolver.setPrefix("/WEB-INF/thymeleaf");
		resolver.setTemplateMode("HTML5");
		return resolver;
	}

	@Bean
	public SpringTemplateEngine templateEngine() {
		SpringTemplateEngine templateEngine = new SpringTemplateEngine();
		templateEngine.setTemplateResolver(templateResolver());
		return templateEngine;
	}

	@Bean
	public ThymeleafViewResolver viewResolver() {
		ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
		viewResolver.setTemplateEngine(templateEngine());
		viewResolver.setOrder(1);
		viewResolver.setViewNames(new String[] {"*.html"});
		return viewResolver;
	}

}

@@ -341,16 +341,92 @@
 ebMvc;%0D%0A
+import org.thymeleaf.extras.springsecurity4.dialect.SpringSecurityDialect;%0D%0A
 import o
@@ -1285,32 +1285,142 @@
 esolver;%0D%0A%09%7D%0D%0A%0D%0A
+%09@Bean%0D%0A%09public SpringSecurityDialect springSecurityDialect() %7B%0D%0A%09%09return new SpringSecurityDialect();%0D%0A%09%7D%0D%0A%0D%0A
 %09@Bean%0D%0A%09public 
@@ -1584,24 +1584,79 @@
 solver());%0D%0A
+%09%09templateEngine.addDialect(springSecurityDialect());%0D%0A
 %09%09return tem

Fix mvc tests that broke with the spring security-thymeleaf change