读书人

Struts2 Action 抛出错误无法正确跳转

发布时间: 2012-09-24 13:49:41 作者: rapoo

Struts2 Action 抛出异常无法正确跳转

try{if (file!=null&&file.length()>0){if(!wsFileUpload.isValidSize(file.length(),wsFileUpload.getLogoPicMaxSize())){throw new Exception("文件超出大小");}if(!wsFileUpload.isValidFile(fileContentType, wsFileUpload.getLogoPicType())){throw new Exception("类型不支持");}//省略其它代码}}catch(Exception e){//e.printStackTrace();//this.addFieldError("uploadErr", e.getMessage()); 该语句加入无法正确跳转到courseeditinfo这个结果this.getRequest().setAttribute("uploadErr", e.getMessage());}finally{this.setCsid(cs.getCourseId().toString());return "courseeditinfo";}


原因何在?

读书人网 >编程

热点推荐