Hi ,
You could use the following
Code:
org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
usage is as follows
Code:
<bean id="exceptionResolver" class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
<property name="exceptionMappings">
<props>
<prop key="org.springframework.dao.DataAccessException">dataAccessFailure</prop>
<prop key="org.springframework.transaction.TransactionException">someother page</prop>
</props>
</property>
</bean>
you should have a view resolver capable of resolving the values mentioned above "dataAccessFailure"
another way is you could otherwise catch the exception in the controller and return a modelAndView yourself.
but by the way why are you using controller?
you should look at abstractcontroller, simpleformcontroller and so on