Springmvc of the @responsebody, return JSON, if there is a solution for garbled Chinese display.
In the SPRINGMVC configuration file
< Bean class = "Org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" > </ Bean >
Viewed the source code of Annotationmethodhandleradapter, and found that its default encoding is Stringhttpmessageconverter object with construction parameters.
Continue to drill down, found that the default encoding Stringhttpmessageconverter is "iso-8859-1", no wonder in the Utf-8 display when the display garbled.
Here's the solution:
In Annotationmethodhandleradapter, the encoding format for custom Stringhttpmessageconverter is UTF-8.
<Beanclass= "Org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"> < Propertyname= "Messageconverters"> <List> <Beanclass= "Org.springframework.http.converter.StringHttpMessageConverter"> < Propertyname= "Supportedmediatypes"> <List> <value>Text/html;charset=utf-8</value> </List> </ Property> </Bean> </List> </ Property> </Bean>
SPRINGMVC @responsebody return JSON, Chinese garbled problem resolution.