首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

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

2012-09-24 
Struts2 Action 抛出异常无法正确跳转try{if (file!null&&file.length()0){if(!wsFileUpload.isValidSiz

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";}


原因何在?

热点排行