问题出现原因
StringHttpMessageConverter中默认编码格式为ISO-8859-1
解决方法
1. 灵活配置
将请求报文头为application/json的charset修改
同时value="/view.html"中去掉html以免响应的报文与请求的报文不一致
@RequestMapping(value="/view",method=RequestMethod.GET,produces={“application/json;charset=UTF-8”})
2. 全局配置
打开springmvc-servlet.xml
同时value="/view.html"中去掉html以免响应的报文与请求的报文不一致
<beans>
<mvc:annotation-driven>
<mvc:message-converters>
<bean class="org.springframework.http.converter.StringHttpMessageConverter">
<property name="supportMediaTypes">
<list>
<value>application/json;charset=UTF-8</value>
</list>
</property>
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
</beans>