SpringMVC 的 json 数据交互

版权声明:转载请注明:beOkWithAnything总结 https://blog.csdn.net/swq463/article/details/81773798


SpringMVC 的 json 数据交互:

    @RequestBody将json串转成java对象(key/value请求时,不需要转换为json(RequestMethod.GET))

    @ResponseBody将java对象转成json串输出

    @ResponseBody
    @RequestMapping(value = "",
                    methed = RequestMethod.POST,
                    produces = "application/json:charset=UTF-8")
    public void getUserInfo(@RequestBody User user){

    }

猜你喜欢

转载自blog.csdn.net/swq463/article/details/81773798