How to catch all exceptions in spring-3.0 mvc application?
I tried something like this:
public class CustomExceptionResolver extends SimpleMappingExceptionResolver { ... }
and
<bean class="com.web.controller.CustomExceptionResolver" autowire="byName">
<property name="exceptionMappings">
<props>
<prop key="java.lang.Exception">uncaughtException</prop>
</props>
</property>
</bean>
But it's still not going to that class whenever I encounter exceptions.
I can't use annotations (eg. @Controller
, @ExceptionHandler
, @ControllerAdvice
)
Lastly, how to use @ControllerAdvice
without annotations? Thanks.