From 47ba6f9913adb987a0fda0e25e101ae34297d725 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Mon, 20 Jun 2016 23:12:06 +0200 Subject: [PATCH] WIP: early 404-detection --- pom.xml | 6 ++++++ src/main/java/de/juplo/thymeproxy/Application.java | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) 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 -- 2.20.1