1.在做用户注册的时候,怎样检查两次输入的密码是否一致?用程序控制呢,还是用dreamwear就可以搞定?
2.比如用户作了一个操作,然后我让他弹出一个确定的对话框,当用户点了确定后就会到我指定的网页去,可是我这么做却做不到而是直接到了指定的网页(代码如下:)
out.print("<script>");
out.print("alert('你好!')");
out.print("</script>");
response.sendRedirect("index.jsp");//(如果没这行代码就能弹出你好的对话框,有了后就不弹了而是直接跳转了,怎么办啊?谢谢!)

解决方案 »

  1.   

    1。在注册时,用户提交后,先在javascript中判断一遍两个密码框的值是否一致。
    如if(document.all.passwrod.value==document.all.password1.value)
    但由于javascript是在客户端的,所以有可能会被人直接绕过,所以最好在程序中对这两个取过来的值再判断一次。
    2。可以试试document.location.href='index.jsp';
      

  2.   

    out.print("<script>");
    out.print("if(alert('你好!'))");
    out.print("window.open('index.jsp')");
    out.print("window.open('');)");
    out.print("</script>");
      

  3.   

    1:用javascript和bean都可以,当然使用两者的话,安全性更高一些;
    2:把这一句:
    response.sendRedirect("index.jsp");
    改成:
    out.print("window.location.href(\"index.jsp\");");
      

  4.   

    用jsp可以解决。。你还记得<faram  />这个东西把。。可以搞定
      

  5.   

    response.sendRedirect...后面最好加个
    return;
    :)
      

  6.   

    用javascript可以做个判断救行。