SpringMVC默认处理的字符集是ISO-8859-1
1.全局修改springmvc.xml文件中
<mvc:annotation-driven ><mvc:message-converters register-defaults="true">
<!--解决中文乱码-->
<bean class="org.springframework.http.converter.StringHttpMessageConverter">
<property name="supportedMediaTypes" value="text/html;charset=UTF-8" />
</bean>
<!-- 启动JSON格式的配置 -->
<bean id="jacksonMessageConverter"
class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
<property name="supportedMediaTypes">
<list>
<value>application/json;charset=UTF-8</value>
</list>
</property>
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
2.局部修改,针对某个请求修改
@RequestMapping(value="mp/getmasssendmsg",produces="text/html;charset=UTF-8")