i have a method secured with spring security as follows:
@PreAuthorize(\"hasRole(\'add_user\')\")
public void addUser(User user) ;
and if a
I have run into the same problem myself and posted another question relating to the same issue. After several hours of digging around, I finally found the solution for my issue. I know this question is 2+ years old, but thought I would update it with information in case it was of value to someone else.
In a nutshell, I noticed that the SimpleMappingExceptionResolver
was handling the exception and resolving it with a default mapping. Consequently, there was no exception left to bubble up the stack to the ExceptionTranslationFilter
which would redirect to the access-denied-handler
.
Please see Spring Security ignoring access-denied-handler with Method Level Security for further information.