各位帮个忙,子窗口打开了,按键不响应servlet,是参数没传进去?

ConsultationServlet:

public void buy(HttpServletRequest request,
HttpServletResponse response) throws IOException {

int rem_id = Integer.parseInt(request.getParameter("hi"));
ConsultationService cs = new ConsultationService();
...
if (rtn.equals("1")) {
response.setContentType("text/html;charset=GBK");

        PrintWriter out = response.getWriter();
        out.write("<script  type=\"text/javascript\">");
        out.print("alert('购买成功!待会诊');");
        // //子窗口刷新父窗口
        out.write("self.opener.location.reload();");
        // 关闭窗口
        out.write("window.opener=null;");
        out.write("window.close();");
        out.write("</script>");
        out.close();

}
这是子窗口jsp代码
function fn(){
var id1 = window.dialogArguments;
document.getElementById("hi").value = id1;
var str="ConsultationServlet?flag=buy&rem_id="+ id1;
alert("您传递的参数为:" + str);

var form = document.getElementById("news");
form.action="ConsultationServlet?flag=buy";
form.submit(); ;

body id="bo" 
form id="news" method="post"
haha
input type="hidden" name="hi" id="hi"
input type="button" value="申请授权" onclick="fn()" 
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问