| ad5081d3  孙向锦
 
初始化项目 | 8
9
10
11
12
13
14
15
16
17
18
19
20
21 |   public class MyExceptionResolver implements HandlerExceptionResolver{
  
  	public ModelAndView resolveException(HttpServletRequest request,
  			HttpServletResponse response, Object handler, Exception ex) {
  		// TODO Auto-generated method stub
  		System.out.println("==============异常开始=============");
  		ex.printStackTrace();
  		System.out.println("==============异常结束=============");
  		ModelAndView mv = new ModelAndView("error");
  		mv.addObject("exception", ex.toString().replaceAll("\n", "<br/>"));
  		return mv;
  	}
  
  }
 |