SpringMVC interface to return a JSON object

First of all clear, and there is no type in JavaScript that said, there is only one type is var. We have to do is to make JavaScript objects we get a return of it in some way to deal with data.

Front-end code

 

Background code

 

 @RequestBody and @ResponseBoy we think these are two opposite operation.

 Development: About @ResponseBoy placement, we have the following categories all

① placed in front of the processor type Returns

② on top of the current controller class that affects all processors of the class

③, into @RestController @Controller two annotations and tags Alternatively @ResponseBody

Guess you like

Origin www.cnblogs.com/kitor/p/10988382.html