From: Kai Moritz Date: Mon, 20 Jun 2016 21:12:06 +0000 (+0200) Subject: WIP: early 404-detection X-Git-Tag: alt~9 X-Git-Url: https://juplo.de/gitweb/?p=maven-thymeleaf-skin;a=commitdiff_plain;h=47ba6f9913adb987a0fda0e25e101ae34297d725 WIP: early 404-detection --- diff --git a/pom.xml b/pom.xml index 7529bde..4a571c0 100644 --- a/pom.xml +++ b/pom.xml @@ -33,6 +33,7 @@ 1.0-SNAPSHOT + 1.0-SNAPSHOT @@ -46,6 +47,11 @@ org.springframework.boot spring-boot-starter-thymeleaf + + de.juplo + thymeproxy + ${thymeproxy.version} + de.juplo httpclient-spring-boot-starter diff --git a/src/main/java/de/juplo/thymeproxy/Application.java b/src/main/java/de/juplo/thymeproxy/Application.java index 9311cf8..6b0ad09 100644 --- a/src/main/java/de/juplo/thymeproxy/Application.java +++ b/src/main/java/de/juplo/thymeproxy/Application.java @@ -18,7 +18,7 @@ import org.springframework.core.env.Environment; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.handler.SimpleMappingExceptionResolver; -import org.springframework.web.servlet.mvc.UrlFilenameViewController; +import org.thymeleaf.TemplateEngine; import org.thymeleaf.resourceresolver.IResourceResolver; import org.thymeleaf.resourceresolver.UrlResourceResolver; import org.thymeleaf.templateresolver.TemplateResolver; @@ -34,7 +34,7 @@ public class Application extends WebMvcConfigurerAdapter @Bean public RegexUrlHandlerMapping proxiedHandlerMapping( ProxyHttpRequestHandler proxy, - UrlFilenameViewController views + UrlThymeleafViewController views ) { RegexUrlHandlerMapping mapping = new RegexUrlHandlerMapping(); @@ -63,9 +63,11 @@ public class Application extends WebMvcConfigurerAdapter } @Bean - public UrlFilenameViewController urlFilenameViewController() + public UrlThymeleafViewController urlThymeleafViewController( + TemplateEngine engine + ) { - return new UrlFilenameViewController(); + return new UrlThymeleafViewController(engine); } @Bean