WIP: early 404-detection
authorKai Moritz <kai@juplo.de>
Mon, 20 Jun 2016 21:12:06 +0000 (23:12 +0200)
committerKai Moritz <kai@juplo.de>
Mon, 20 Jun 2016 21:40:59 +0000 (23:40 +0200)
pom.xml
src/main/java/de/juplo/thymeproxy/Application.java

diff --git a/pom.xml b/pom.xml
index 7529bde..4a571c0 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -33,6 +33,7 @@
 
     <!-- used versions (not defined in spring-boot) -->
     <httpclient-spring-boot-starter.version>1.0-SNAPSHOT</httpclient-spring-boot-starter.version>
+    <thymeproxy.version>1.0-SNAPSHOT</thymeproxy.version>
 
   </properties>
 
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-starter-thymeleaf</artifactId>
     </dependency>
+    <dependency>
+      <groupId>de.juplo</groupId>
+      <artifactId>thymeproxy</artifactId>
+      <version>${thymeproxy.version}</version>
+    </dependency>
     <dependency>
       <groupId>de.juplo</groupId>
       <artifactId>httpclient-spring-boot-starter</artifactId>
index 9311cf8..6b0ad09 100644 (file)
@@ -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