SpringMVC异常

来源:互联网 发布:华北油田网络手机报 编辑:程序博客网 时间:2024/06/15 06:15
@Controllerpublic class Myexection {    @RequestMapping("/list")    public String exe(){
        int resule=5/0;//异常        return "/list.jsp";    }}
配置中:
<!--开启异常--><bean class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">  <property name="defaultErrorView" value="exection.jsp"></property></bean>
在这里我给了一个算数异常,发现异常不会执行下面代码,会走到配置文件中找到 exection.jsp这个页面
原创粉丝点击