I'm working on a project where the exception handling was created by someone else who is no longer here to help.
They've created the following bean which catches all uncaught exceptions and forwards to a JSP View.
<bean id="exceptionResolver" class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
<property name="exceptionMappings">
<map>
<entry key="java.lang.Exception" value="error"/>
</map>
</property>
<property name="defaultErrorView" value="error" />
</bean>
It works fine, but what if I want to get a hold of the exception thrown and report it in our logs? How do I forward this to a Java class instead of a View?
Set the properties for warnLogCategory
. See the class Javadoc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With