if (条件成立) {
        response.sendRedirect("index.jsp");
        return;
    }

解决方案 »

  1.   

    程序碰到return 后边代码的就不执行了
    碰到response.sendRedirect 或者 RequestDispatcher.forward,是要执行完这个方法的所有代码后才跳转的
      

  2.   

    应该注意先后顺序 吧
    还有就是有没有ruturn false阻止了你的程序
    还有。
      

  3.   

    对比return与response.sendRedirect 或者 RequestDispatcher.forward的区别
      

  4.   

    用页面转发标签<jsp:forward page="login.jsp">
      

  5.   

    if (条件成立) {
            response.sendRedirect("index.jsp");
        }=====================
    return 去掉就OK了;