lindbird
Feb 9th, 2006, 02:33 PM
Hello, I am trying to implement a controller which handles all exceptions resolved by a SimpleMappingExceptionResolver:
<bean id="exceptionResolver" class="org.springframework.web.servlet.handler.SimpleMapp ingExceptionResolver">
<property name="defaultErrorView">
<value>redirect:errors.do</value>
</property>
<property name="exceptionAttribute">
<value>myException</value>
</property>
</bean>
I have mapped a controller to "errors.do" which extends AbstractController:
<bean id="myErrorsController" class="ui.controller.MyErrorsController">
<property name="view">
<value>error/default-error</value>
</property>
</bean>
My question is how do I get the original thrown exception to my errors controller so I can process it. I know I could extend SimpleMappingExceptionResolver and put it into session or something, but I was under the assumption that I had access to the exception through the model... I thought that the exceptionAttribute had something to do with it but I guess not... any suggestions?
thanks,
Ryan
<bean id="exceptionResolver" class="org.springframework.web.servlet.handler.SimpleMapp ingExceptionResolver">
<property name="defaultErrorView">
<value>redirect:errors.do</value>
</property>
<property name="exceptionAttribute">
<value>myException</value>
</property>
</bean>
I have mapped a controller to "errors.do" which extends AbstractController:
<bean id="myErrorsController" class="ui.controller.MyErrorsController">
<property name="view">
<value>error/default-error</value>
</property>
</bean>
My question is how do I get the original thrown exception to my errors controller so I can process it. I know I could extend SimpleMappingExceptionResolver and put it into session or something, but I was under the assumption that I had access to the exception through the model... I thought that the exceptionAttribute had something to do with it but I guess not... any suggestions?
thanks,
Ryan