Centralize validation and exception handling with @ControllerAdvice

1 Introduction The ControllerAdvice annotation introduced by Spring 3.2 allows us to handle several functionalities in a way that can be shared by all controllers (through its handler methods, annotated with @RequestMapping). This annotation is mainly used to define the following methods: @ExceptionHandler: Handles exceptions…