From c825b607c725b5e0d10d826b65b6a183a81540e7 Mon Sep 17 00:00:00 2001 From: Alexander Alexeev Date: Fri, 11 Nov 2016 01:55:55 +0700 Subject: logback configurations are copied --- .../components/configuration/CrosspostConfiguration.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'juick-crosspost/src/main/java/com/juick') diff --git a/juick-crosspost/src/main/java/com/juick/components/configuration/CrosspostConfiguration.java b/juick-crosspost/src/main/java/com/juick/components/configuration/CrosspostConfiguration.java index 069037ee..8ae511c4 100644 --- a/juick-crosspost/src/main/java/com/juick/components/configuration/CrosspostConfiguration.java +++ b/juick-crosspost/src/main/java/com/juick/components/configuration/CrosspostConfiguration.java @@ -8,10 +8,12 @@ import com.mitchellbosecke.pebble.loader.Loader; import com.mitchellbosecke.pebble.loader.ServletLoader; import com.mitchellbosecke.pebble.spring4.PebbleViewResolver; import com.mitchellbosecke.pebble.spring4.extension.SpringExtension; +import org.springframework.beans.factory.config.PlaceholderConfigurerSupport; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; +import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; import org.springframework.core.env.Environment; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; @@ -42,6 +44,15 @@ public class CrosspostConfiguration extends WebMvcConfigurationSupport { @Inject private JdbcTemplate jdbc; + @Bean + public static PlaceholderConfigurerSupport propertySourcesPlaceholderConfigurer() { + PlaceholderConfigurerSupport configurer = new PropertySourcesPlaceholderConfigurer(); + + configurer.setFileEncoding("utf-8"); + configurer.setOrder(1); + return configurer; + } + @Bean public Loader templateLoader() { return new ServletLoader(servletContext); -- cgit v1.2.3