spring mvc 对异常的处理
1、在控制器添加异常处理@Exception'Handle(异常类名)public String handle(类名){ return “异常的页面”;}发生指定异常时跳转

2、这种异常处理方式并不能处理404请求错误,需要在web.xml配置错误页面<error-page> <exception-type>java.lang.Throwable</exception-type> <location>/WEB-INF/views/error/404.jsp</location> </error-page>

4、@RequestMapping(value="/delete",method=RequestMethod.GET,produces="text/html;charset=UTF-8") public String delete(RedirectAttributes ra,String id,HttpServletRequest request){

6、return "redirect:1/dealerList?jyxkz="+StringUtils.nullTo(d.get("jyxkz"))+"&name="+StringUtils.nullTo(d.get("name"))

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:69
阅读量:81
阅读量:94
阅读量:36
阅读量:81