From 1629ad50dd2732bdf442933a489e157bc875c7c9 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Thu, 16 Jun 2016 17:08:53 +0200 Subject: [PATCH] WIP: thymeproxy ohne thymeproxy --- pom.xml | 6 ----- .../java/de/juplo/thymeproxy/Application.java | 22 +++++++++++++++++++ src/main/resources/application.properties | 3 --- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index 5d51982..b635b71 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,6 @@ 1.0-SNAPSHOT - 1.0-SNAPSHOT @@ -47,11 +46,6 @@ 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 a9831ba..d4ccd53 100644 --- a/src/main/java/de/juplo/thymeproxy/Application.java +++ b/src/main/java/de/juplo/thymeproxy/Application.java @@ -54,6 +54,28 @@ public class Application return new UrlFilenameViewController(); } + @Bean + public TemplateResolver defaultTemplateResolver( + IResourceResolver resources, + Environment env + ) + { + TemplateResolver resolver = new TemplateResolver(); + resolver.setResourceResolver(resources); + resolver.setPrefix("http://localhost:8080/thymeleaf/"); + resolver.setSuffix(".html"); + resolver.setTemplateMode("HTML5"); + resolver.setCharacterEncoding("UTF-8"); + resolver.setCacheable(Boolean.valueOf(env.getProperty("thymeproxy.cacheable"))); + return resolver; + } + + @Bean + public UrlResourceResolver thymeleafResourceResolver() + { + return new UrlResourceResolver(); + } + public static void main(String[] args) { diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 92754df..1ba166f 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -2,9 +2,6 @@ thymeproxy.name=@thymeproxy.name@ thymeproxy.origin=@thymeproxy.origin@ server.port=@thymeproxy.port@ thymeproxy.ttl=@thymeproxy.ttl@ -thymeproxy.origins[0].uri=http://localhost:8080 -thymeproxy.origins[0].prefix=/thymeleaf/ -thymeproxy.origins[0].suffix=.html thymeproxy.cacheable=@thymeproxy.cacheable@ logging.level.de.juplo=info -- 2.20.1