From 697c2101558cb95943cc910c6ed373c756e46ee9 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Thu, 13 Jun 2013 13:46:21 +0100 Subject: [PATCH] Add cacheable switch to Thymeleaf template resolver User can set spring.template.cache=false to change the behaviour --- .../autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spring-bootstrap/src/main/java/org/springframework/bootstrap/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java b/spring-bootstrap/src/main/java/org/springframework/bootstrap/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java index 8a7f88ef90..8aed8834a8 100644 --- a/spring-bootstrap/src/main/java/org/springframework/bootstrap/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java +++ b/spring-bootstrap/src/main/java/org/springframework/bootstrap/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java @@ -67,6 +67,9 @@ public class ThymeleafAutoConfiguration { @Value("${spring.template.suffix:.html}") private String suffix = ".html"; + @Value("${spring.template.cache:true}") + private boolean cacheable; + @Value("${spring.template.mode:HTML5}") private String templateMode = "HTML5"; @@ -94,6 +97,7 @@ public class ThymeleafAutoConfiguration { resolver.setPrefix(this.prefix); resolver.setSuffix(this.suffix); resolver.setTemplateMode(this.templateMode); + resolver.setCacheable(this.cacheable); return resolver; }