The 1.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.
2.Stringhttpmessageconverter has a list<mediatype> supportedmediatypes attribute in the parent class to store Stringhttpmessageconverter supports mediatype types that require special handling, if the type of mediatype to be processed is not Supportedmediatypes list, the default character set is used.
3. Workaround, simply add the following code to the configuration file:
<!--SPRINGMVC The JSON value is resolved--><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>
4. If you need to handle othermediatype type, you can add other value tags to the list label