JSP 中 reponse.sendRedirect 多次调用后的bug

来源:互联网 发布:c语言函数调用 编辑:程序博客网 时间:2024/05/19 02:17

   今天碰到了诡异的问题 reponse.sendRedirect 多次调用后,会不可用,就是执行了sendRedirect后(return了),没有跳转到指定的页面,而是一直停留在空白页面,不知何故。

   解决方法:

把 reponse.sendRedirect 跳转改成JS 跳转,代码如下:

out.print("<script>window.location.href='" + request.getContextPath() + "/UserAuthMessage.jsp';</script>");        return;