spring return json data to the front-end considerations

1.

Remember to join SpringJSON analytical package, otherwise the spring can not be returned pojo class of analytic data into json

plus the following maven dependencies

<!--    SpringJSON解析包-->
<jackson.version>2.9.9</jackson.version>
.
.
.
.
.
.
<dependency> 
<the groupId> com.fasterxml.jackson.core </ the groupId>
<the artifactId> Jackson-DataBind </ the artifactId>
<Version> jackson.version $ {} </ Version>
</ dependency>

2.
remember the data type changed
dataType: 'json',
Otherwise, only the return data to identify a string, can not get attribute parameters data.xxx

 

 







Guess you like

Origin www.cnblogs.com/c2g5201314/p/11601291.html