Here I use Ajax asynchronous requests to the back of the console controller, first Ajax is to determine the legality of the user name, and the second is to receive backstage pass over Ajax object data, and the third is receiving a pass over the background of the set.
Please see below controller console code
Annotation @ResponseBody the method body, return type may also be Map, Array like. The processor is configured to help us json JSON format string, reduce the workload.
Ajax ordinary asynchronous request is different, the HttpServletResponse SPRINGMVC need not be employed, only need to add annotations @ResponseBody in the above method can be a need to configure the processing returns ResponseBody json encoding format and the conversion SpringMCV After the addition, the following process is ResponseBody json return code conversion and encoding format:
PS: If you have something to deal with static resources in your SpringMVC configuration <mvc:annotation-driven/>requires you deal ResponseBody return code encoding format on top of it, it still will be Chinese garbled.