I’ve annotated one of my controllers with
@ExceptionHandler, in hopes of handling the exceptions for that class within the following method.
We also have a site-wide exception handler defined in XML (
SimpleMappingExceptionResolver is still handling exceptions in my controller with an
How can I get the controller specific exception handler to deal with exceptions coming from its controller?
Answered in tremendous depth and clarity here:
Basically it says to add the
AnnotationMethodHandlerExceptionResolver manually (adding
SimpleMappingExceptionResolver causes the Annotation resolver not to be automatically added), and set the order of the two Resolvers.
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver" p:order="1" />