学习笔记:遇见Cannot forward after response has been committed

写的一个登陆的程序,当点击登陆后,出现这个错误。  

try{
			request.setAttribute("user", user);
			request.getRequestDispatcher("index.jsp").forward(request, response);//跳转
			//return //加上return就解决了
		}catch (Exception e) {
			e.printStackTrace();
			request.setAttribute("sthWrong", "对不起,登录出错了,请重试");
		}
		request.getRequestDispatcher("/WEB-INF/jsp/login.jsp").forward(request, response);//又转 出错



其他的参见 http://blog.csdn.net/fenglibing/article/details/4106564

你可能感兴趣的:(javaWeb)