Add spring.messages.cacheSeconds to global config

Fixes gh-625
This commit is contained in:
Dave Syer 2014-04-03 14:07:55 +01:00
parent 72d7c286c0
commit 5ed49462c4
2 changed files with 3 additions and 0 deletions

View File

@ -58,6 +58,8 @@ public class MessageSourceAutoConfiguration implements EnvironmentAware {
}
String encoding = this.environment.getProperty("encoding", "utf-8");
messageSource.setDefaultEncoding(encoding);
messageSource.setCacheSeconds(this.environment.getProperty("cacheSeconds",
Integer.class, -1));
return messageSource;
}

View File

@ -81,6 +81,7 @@ content into your application; rather pick only the properties that you need.
# INTERNATIONALIZATION ({sc-spring-boot-autoconfigure}/MessageSourceAutoConfiguration.{sc-ext}[MessageSourceAutoConfiguration])
spring.messages.basename=messages
spring.messages.encoding=UTF-8
spring.messages.cacheSeconds=-1
[[common-application-properties-security]]
# SECURITY ({sc-spring-boot-autoconfigure}/security/SecurityProperties.{sc-ext}[SecurityProperties])