Cause: SPRINGMVC in processing the request, the default is the ISO-8859-1 encoding format, for specific reasons do not understand, the individual feel that there is no time to change, so in the processing of some JSON format, will appear in Chinese garbled.
The Org.springframework.http.converter.StringHttpMessageConverter class is a class that processes requests or corresponding strings, and the default character set is Iso-8859-1, so garbled when there is Chinese in the return JSON.
workaround, simply add the following code to the configuration file:
<!--to return JSON strings when processing requests-the Chinese characters-- <mvc:annotation-driven> <mvc:message-converters> <bean class= "Org.springframework.http.converter.StringHttpMessageConverter" > <property name= " Supportedmediatypes "> <list> <value>application/json;charset=UTF-8</value> </list> </property> </bean> </MVC:MESSAGE-CONVERTERS></MVC: Annotation-driven>
SPRINGMVC 4.x processing JSON data is garbled in Chinese