Welcome to Simple Programming
@Exceptionhandler used to catch any exception in a controller
You can have multiple methods annotated with exception handler inside this controller with valid exceptions.
Drawback:
these exception handlers are active only inside that controller. we don’t want that, and that is not a good coding strategy.
If there are multiple controllers, we need to segregate the exceptions handlers into a common class so that it looks elegant and easy to maintain in future
There is an annotation available that makes it happen, it is called @ControllerAdvice
let us see how it works in our next video
Thanks for watching and please subscribe for more such videos
Auf dieser Seite können Sie das Online-Video Spring Boot - Exception Handler | Simple Programming mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Simple Programming 06 September 2018 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 22,550 Mal angesehen und es wurde von 187 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!