<!-- system error forwarding configuration [and logging error log] --><bean class=] Org.springframework.web.servlet.handler.SimpleMappingExceptionResolver "><property name=" Defaulterrorview " value=" error ></property> <!-- Default is 500, system error (ERROR.JSP) --><property name= "Defaultstatuscode" value= "></property><property" name= "Statuscodes" ><!-- Configure multiple statuscode --> <props> <prop key= "Error" >500</prop> <!-- error.jsp --> <prop key= "Error1" >404</prop> <!-- error1.jsp --> </props> </property> <property name= "Exceptionmappings" ><props><!-- Here you can define n multiple error exception forwarding --><prop key= as needed "java.sql. SQLException ">dbError</prop> <!-- Database error (dberror.jsp) --><prop key=" Org.springframework.web.bind.ServletRequestBindingException ">bizError</prop> <!-- Parameter binding error (such as: Must not pass the parameter) (bizerror.jsp) --><prop key= "Java.lang.IllegalArgumentException" >bizError</prop> <!-- Parameter error (bizerror.jsp) --><prop key= " Org.springframework.validation.BindException ">bizError</prop> <!-- parameter type wrong ( bizerror.jsp) --><prop key= "Java.lang.Exception" >unknowerror</prop> <!- - other errors are ' undefined errors ' (unknowerror.jsp) --></props></property></bean>
Spring Exception Handling Configuration