<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd">

    <description>spring 异常处理</description>

    <!-- 自定义SimpleMappingExceptionResolver覆盖spring的SimpleMappingExceptionResolver -->
    <bean id="springExceptionResolver" class=" com.zw.common.SpringSimpleMappingExceptionHandler">
        <property name="exceptionMappings">
            <props>
                <prop key="com.zw.platform.util.common.SystemException">html/errors/error_500</prop>
                <prop key="com.zw.common.exception.BusinessException">html/errors/error_exception</prop>
                <prop key="java.io.IOException">html/errors/error_exception</prop>
                <prop key="java.sql.SQLException">html/errors/error_exception</prop>
                <prop key="java.lang.Throwable">html/errors/error_exception</prop>
                <prop key="java.lang.Exception">html/errors/error_exception</prop>
            </props>
        </property>
        <!-- 设置日志输出级别，不定义则默认不输出警告等错误日志信息 -->
        <property name="warnLogCategory" value="WARN"></property>
        <!-- 默认错误页面，当找不到上面mappings中指定的异常对应视图时，使用本默认配置 -->
        <property name="defaultErrorView" value="html/errors/error_exception"></property>
        <!-- 默认HTTP状态码 -->
        <property name="defaultStatusCode" value="500"></property>
        <!-- 定义异常处理页面用来获取异常信息的变量名，如果不添加exceptionAttribute属性，则默认为exception -->  
        <property name="exceptionAttribute" value="exception"/>  
    </bean>
</beans>