spring mvc HandlerExceptionResolver视图转发无效
public class ExceptionHandle implements HandlerExceptionResolver {
public ModelAndView resolveException(HttpServletRequest request,
HttpServletResponse response, Object handler, Exception ex) {
Map<String, Object> model = new HashMap<String, Object>();
model.put("ex", ex.getMessage());
System.out.println("进入异常处理页面..");
return new ModelAndView("error", model);
}
}
控制台可以打印出“进入异常处理页面..”,可是前台页面没有转发到error.jsp异常页面
------解决方案--------------------ModelAndView用的是哪个?应该使用org.springframework.web.
servlet.ModelAndView,不是portlet这个。