java.lang.IllegalStateException: Cannot call sendRedirect() after the response has been committed

来源:互联网 发布:linux的chown命令 编辑:程序博客网 时间:2024/05/22 10:58

AJAX+JSP时,out.write('content')之后,如果后面还有代码,无法被执行到,会报错,java.lang.IllegalStateException: Cannot call sendRedirect() after the response has been committed。


可以在out.write('content');这句代码后面加:return;令下面的代码sendRedirect不再执行。后台就不会报错了。

0 1