首先FreeMarker模板中<head>加入 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Spring配置文件中作如下设置:
1. 在freemarkerConfig中配置 <prop key="default_encoding">UTF-8</prop>
2. 在viewResolver中配置<property name="contentType" value="text/html;charset=UTF-8"></property>