3

Situation

I'm having a controller class with try catch exception handling within the controller class. Lately I have been trying to move the traditional try catch block to spring's @ControllerAdvice and @ExceptionHandler.

However my controller is having a finally block. So I have been looking all over to see how finally block can be handled while using @ControllerAdvice and @ExceptionHandler method. I'm unable to find any solution to handle the situation.

Any help is appreciated.

  • 4
    You're allowed to have a finally block without a catch block. Just leave the finally block in the controller, where it belongs. – JB Nizet Jul 03 '17 at 11:17

0 Answers0