springmvc之异常处理DefaultHandlerExceptionResolver

直接看代码:

在Java中:

    @RequestMapping(value="/testDefaultHandlerExceptionResolver",method=RequestMethod.POST)
    public String testDefaultHandlerExceptionResolver() {
        System.out.println("testDefaultHandlerExceptionResolver执行。。。");
        return "succes";
    }

index.jsp

<a href="testDefaultHandlerExceptionResolver">testDefaultHandlerExceptionResolver</a>

启动服务器:

点击:

不支持GET方法。

这种特定的异常是DefaultHandlerExceptionResolver进行处理的。

原文地址:https://www.cnblogs.com/xiximayou/p/12196875.html