Use developer.defeatFreemarkerCache=true
Previously was Environment.build=development
This commit is contained in:
parent
21e9698df2
commit
885bbabdae
1 changed files with 7 additions and 5 deletions
|
@ -37,6 +37,8 @@ public class FreemarkerConfiguration extends Configuration {
|
||||||
|
|
||||||
private static final Log log = LogFactory.getLog(FreemarkerConfiguration.class);
|
private static final Log log = LogFactory.getLog(FreemarkerConfiguration.class);
|
||||||
|
|
||||||
|
private static final String PROPERTY_DEVELOPER_DEFEAT_CACHE = "developer.defeatFreemarkerCache";
|
||||||
|
|
||||||
private final String themeDir;
|
private final String themeDir;
|
||||||
private final ServletContext context;
|
private final ServletContext context;
|
||||||
private final ApplicationBean appBean;
|
private final ApplicationBean appBean;
|
||||||
|
@ -47,9 +49,9 @@ public class FreemarkerConfiguration extends Configuration {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.appBean = appBean;
|
this.appBean = appBean;
|
||||||
|
|
||||||
String buildEnv = ConfigurationProperties.getBean(context).getProperty("Environment.build");
|
String flag = ConfigurationProperties.getBean(context).getProperty(
|
||||||
log.debug("Current build environment: " + buildEnv);
|
PROPERTY_DEVELOPER_DEFEAT_CACHE, "false");
|
||||||
if ("development".equals(buildEnv)) { // Set Environment.build = development in deploy.properties
|
if (Boolean.valueOf(flag.trim())) {
|
||||||
log.debug("Disabling Freemarker template caching in development build.");
|
log.debug("Disabling Freemarker template caching in development build.");
|
||||||
setTemplateUpdateDelay(0); // no template caching in development
|
setTemplateUpdateDelay(0); // no template caching in development
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue