serlvet的代码:(其实servlet里面不作任何事情,也弹出这个窗口,我想有没有办法把respose转到a.jsp中?)
package oamodule.examine;import javax.servlet.*;public class QuestionSetOperator extends HttpServlet {
  //Initialize global variables
  public void init() throws ServletException {
  }
  public void doPost(HttpServletRequest request, ttpServletResponse response) throws ServletException, IOException {
    HttpSession session = request.getSession();
    QuestionSetManager QuestionSetM=(QuestionSetManager)(session.getAttribute("QuestionSetManager"));
 }
  public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    doPost(request,response);
  }
  //Clean up resources
  public void destroy() {
  }
}

解决方案 »

  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.   

    <OBJECT id=hh3 classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
                <PARAM NAME="Command" VALUE="Close"></OBJECT>
               <input type=button value=确定 onclick=hh3.Click()>
    试试这个!
      

  3.   

    去掉parent.location="a.html";行吗过个好节:)
      

  4.   

    ----------------------------------------------------------
    b.jsp中一个按钮链接一个servlet后window.close()
    ----------------------------------------------------------按钮怎么链接servelt的?如果是button按钮的onclick=open("..."),试试改成iframe1.location="...",如果是submit按钮则把form的target指向iframe1。其中iframe1是放在页面中的隐藏帧,不显示。参见:http://www.csdn.net/expert/topic/1061/1061875.xml?temp=.1173822这几天这个问题怎么老被问起呢?期中考的题目吗?