Spring MVC 3.2 @ResponseBody interceptor

后端 未结 4 2122
北荒
北荒 2021-02-05 22:28

In our application we are using JSON for request and response. The controller methods are annotated with @RequestBody(). The object being returned e.g. TransferResponse. I would

4条回答
  •  清酒与你
    2021-02-05 22:54

    Like Pavel said, you probably can't get to the response JSON this way. I think the best bet is to implement a Filter that looks at the response prior to writing it to the client. Have a look at OncePerRequestFilter for a starting point.

提交回复
热议问题