First it is necessary to say that JSON and JSON strings are not the same, the latter is a string. And JSON is an object
Of course, if the call location is a daemon this is almost indistinguishable, because in the background, regardless of the format data, the string is read from the response stream.
But there's a big difference in the front end.
Yes, it's a string,
This taxs is saved in the previous step.
Looking at another request
This is the JSON object.
These two forms, in fact, a difference is in the return of the header information in the Content-type
If Content-type is Application/json, the browser automatically converts to a JSON object after receiving the object, and if it is text/html, it is passed to the callback function as a string
Three ways to return objects in JSON form in the background here is not much to say, is two configurations and a @responsebody
If this sentence is configured in Spring-mvc.xml (which is not necessarily the name of this file), the JSON object is returned, otherwise the JSON string is returned.
The personal guess is that in this configuration file there should be an interceptor that modifies the default Content-type
<mvc:annotation-driven content-negotiation-manager= "Contentnegotiationmanager"/>
Spring MVC returns JSON format and JSON string