吹静静

欢迎QQ交流:592590682

a.为当前Controller配置错误处理

b.配置全局的错误处理

 

c.通过配置文件方式实现全局错误处理

    <bean class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
        <property name="exceptionMappings">
            <props>
                <prop key="java.lang.ArithmeticException">error</prop>
            </props>
        </property>
    </bean>

 

posted on 2018-10-25 14:30  吹静静  阅读(144)  评论(0编辑  收藏  举报