Java中出现Unhandled exception的原因

说明某个方法在方法声明上已经声明了会抛异常,那么在调用这个方法的时候,就必须做异常处理,处理的方式有2种,要么try-catch这个异常,要么继续往上一层抛出这个异常,这是java语法要求的,
必须这么做

public void  getFireWalls(HttpServletResponse response, HttpServletRequest request, HttpSession session)
throws IOException {

UserModel u = AuthUtil.getLoginUser(request);
String path = request.getParameter("path");
path = URLDecoder.decode(path, "UTF-8");

 

posted @ 2019-07-22 16:44  背着泰山找黄河  阅读(6266)  评论(0编辑  收藏  举报