How to handle exceptions in Spring MVC?

Spring MVC provides the following three options for exception handling :
 
* @ExceptionHandler Annotation : ExceptionHandler is a Spring annotation handle exceptions thrown by request handling. This annotation works at the @Controller level.

* <em><strong>@ControllerAdvice</strong></em> Annotation : This annotation supports global Exception handler mechanism. A controller advice allows you to use exactly the same exception handling techniques but applies them across the application, not just to an individual controller.

* HandlerExceptionResolver : Resolve any exception thrown by the application.