其实servlet里面不作任何事情,也弹出这个窗口,我想有没有办法把respose转到a.jsp中?

解决方案 »

  1.   

    a.jsp代码:
    <html>
    <title>试卷管理</title>
    <body rightmargin="0" leftmargin="0"  topmargin="0" scroll=no class=body>
    <script LANGUAGE="javascript">
    <!--
    function add()
    {
      window.showModalDialog("b.html","","dialogHeight:105px;dialogWidth:245px;center:yes;edge:raised;scroll:no;status:no;unadorned:yes;");
      parent.location="a.html";
    }
    //-->
    </script>
    <input type=button name=add value=add onclick=javascript:add()></body>
    </html>
    b.jsp代码:
    <html>
    <head>
    <title>新增<%=showType%></title>
    <link rel="STYLESHEET" type="text/css" href="../common/Css/Public.css">
    <script LANGUAGE="javascript">
    <!--
    function CloseWindow(){
      window.close();
    }
    function Action(){
      window.addinfo.submit();
      window.close();
    }
    //-->
    </script>
    </head><body leftmargin="0" topmargin="0" rightmargin="0" class=body>
    <form method="POST" name=addinfo action="questionsetoperator">
    <table width="100%">
        <p align="right"><input type="button" value="确定" name="OK" onclick=javascript:Action()>
        <input type="button" value="取消" name="cancel" onclick=javascript:CloseWindow()></p>
      </td>
      </tr>
    </table>
    </form>
    </body>
    这里questionsetoperator是指向servlet
      

  2.   

    questionsetoperator你在servlet中dopost(){
    返回
    <script>Javascript:top.window.close();</script>
    到前台即可
    }