简体   繁体   中英

How to get the @RequestBody in an @ExceptionHandler (Spring REST) 2.0

I know How to get the @RequestBody in an @ExceptionHandler (Spring REST) exists but I am looking for a slightly different solution. When my service gets a 403 it does not make it to my @Controller class. Thus, how can I still grab something out of the incoming request body, since this scenario would never actually hit my code? It only ever hits the generated CGLIB code.

Ultimately I was able to solve the issue by creating a class that extends RequestBodyAdviceAdapter .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM