Cannot call sendRedirect() after the response has been committed

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

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

posted @ 2016-08-19 09:23  wujixing909  阅读(1007)  评论(0编辑  收藏  举报