From 71adc5f8430fbadbf7b10aa2c43c0cb8dce6ea92 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 30 Jun 2017 10:13:55 +0300 Subject: Pebble 2.4.0 with characterEncoding workaround --- .../java/com/juick/www/configuration/WwwServletConfiguration.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'juick-www/src/main/java/com/juick/www/configuration') diff --git a/juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java b/juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java index d7e5c72e..beba1597 100644 --- a/juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java +++ b/juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java @@ -6,14 +6,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.apache.commons.codec.CharEncoding; 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.core.env.Environment; import org.springframework.http.CacheControl; -import org.springframework.web.multipart.MultipartResolver; -import org.springframework.web.multipart.commons.CommonsMultipartResolver; import org.springframework.web.servlet.ViewResolver; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; @@ -88,6 +86,7 @@ public class WwwServletConfiguration extends WebMvcConfigurationSupport { viewResolver.setPrefix("/WEB-INF/"); viewResolver.setSuffix(".html"); viewResolver.setPebbleEngine(pebbleEngine()); + viewResolver.setCharacterEncoding(CharEncoding.UTF_8); return viewResolver; } } -- cgit v1.2.3