空指针错误是不是你的判定条件的 错?
response.sendRedirect() 应该不会出现这种错误,
我一直用的它。

解决方案 »

  1.   

    应该是你判断条件错误,不行的话你用<jsp:forward>指令试一下
      

  2.   

    我如果注销
    <%
      if (判定接收的条件)
       //response.sendRedirect("index.htm");
       out.println("OK");
      else
       out.println("error");%>同样的条件,后台就没有什么错误提示了。
      

  3.   

    这样的话就用javascript写吧
    我就是:)
    <%
      if (判定接收的条件)
    %>
    <script>
    window.location="index.htm";
    </script>
    <%  else
       out.println("error");%>
      

  4.   

    我的验证条件是调用一个bean里面的过程,返回一个boolean型的数据,所以不好用jS,代码如下:
    <%
    if ( testbean.check(str1,str2,str3))
    {
       session.setAttribute("str",str1);
                response.sendRedirect("index.htm");
    }
    else
      out.println("验证错误,请检查输入的是否正确!");
    %>如果注释掉response.sendRedirect("index.htm");
    就没有任何问题。