aboutsummaryrefslogtreecommitdiff
path: root/juick-spring-www/src/main/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'juick-spring-www/src/main/java/com')
-rw-r--r--juick-spring-www/src/main/java/com/juick/www/configuration/WwwInitializer.java7
-rw-r--r--juick-spring-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java3
2 files changed, 4 insertions, 6 deletions
diff --git a/juick-spring-www/src/main/java/com/juick/www/configuration/WwwInitializer.java b/juick-spring-www/src/main/java/com/juick/www/configuration/WwwInitializer.java
index d5a3bbeff..e62b1042e 100644
--- a/juick-spring-www/src/main/java/com/juick/www/configuration/WwwInitializer.java
+++ b/juick-spring-www/src/main/java/com/juick/www/configuration/WwwInitializer.java
@@ -39,13 +39,8 @@ public class WwwInitializer extends AbstractAnnotationConfigDispatcherServletIni
public void onStartup(ServletContext servletContext) throws ServletException {
super.onStartup(servletContext);
- CharacterEncodingFilter encodingFilter = new CharacterEncodingFilter();
-
- encodingFilter.setEncoding("UTF-8");
- encodingFilter.setForceEncoding(true);
-
FilterRegistration.Dynamic registration = servletContext.addFilter(
- "encodingFilter", new CharacterEncodingFilter());
+ "encodingFilter", new CharacterEncodingFilter("UTF-8", true));
registration.addMappingForUrlPatterns(null, true, "/*");
}
diff --git a/juick-spring-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java b/juick-spring-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java
index 5c17897c7..9a2bb1d41 100644
--- a/juick-spring-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java
+++ b/juick-spring-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java
@@ -45,6 +45,8 @@ public class WwwServletConfiguration extends WebMvcConfigurationSupport {
// Template cache is true by default. Set to false if you want
// templates to be automatically updated when modified.
templateResolver.setCacheable(true);
+
+ templateResolver.setCharacterEncoding("UTF-8");
return templateResolver;
}
@@ -72,6 +74,7 @@ public class WwwServletConfiguration extends WebMvcConfigurationSupport {
public ThymeleafViewResolver viewResolver() {
ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
viewResolver.setTemplateEngine(templateEngine());
+ viewResolver.setCharacterEncoding("UTF-8");
return viewResolver;
}