- 方法级别:
- @RequestMapping("testException2")
- public String testException2(@RequestParam("i") Integer i) {
- System.out.println("---------------join Exception111111111111111111111-------------");
- System.out.println(i);
- if(i !=
1){
- System.out.println("如果程序抛出异常将会重定向至方法异常处理");
- return
"redirect:testMethodExcesption";
- }
- return
"MyJsp";
}
- //方法异常处理
- @ResponseStatus(value=HttpStatus.CONTINUE,reason="错误信息")
- @RequestMapping("testMethodExcesption")
- public String testMethodExcesption(){
- System.out.println("join---------------testMethodExcesption");
- return
"MyJsp";
- }
|