I am trying to implement CommonExceptionHandler class in my project. I searched on google there are multiple methods to achieve it. The two most common I found are above one. Please help me , When I should use AccessDeniedHandler (Interface) and ResponseEntityExceptionHandler (Class).

Do they make any difference when I enabled Security configuration in the project.?