function bbsInsert(forum_id, topic_id){
    //发表回帖
    //判断输入内容是否为空,如果为空,不做处理,否则提交给TopicServlet
    if(document.frmAction.content.value == null ||
    checkLength(document.frmAction.content.value)<1){
     alert('请输入内容!');
        document.frmAction.action="topicservlet?method=topic_view&forum_id=" + forum_id + "&topic_id=" + topic_id;
        document.frmAction.submit();
        return ;
    }
    alert("有输入内容");
    document.frmAction.action="topicservlet?method=answer_add&forum_id="+forum_id+"&parent_id="+topic_id;
    document.frmAction.submit();
}
如果贴子有内容就交给topicservlet(TopicSetvlet类)。但是点击“提交按钮”,只是浏览器地址变了 ,TopicSetvlet并没有接收到这个请求?请问是怎么回事?
    <tr>
        <td  bgColor=#E4E8EF>快速回复:</td>
        <td   bgColor=#E4E8EF>
           <textarea name="content" rows=8 cols=80 align="left"><%=replyContent%></textarea><br>
           <img src="images/newreply.gif" align=left onclick="bbsInsert(<%=forum_id%>, <%=topic_id%>);"/>
        </td>
    </tr>
这是调用上面javascript函数的表单元素

解决方案 »

  1.   

    <form  method="post" name="frm" id="frm">
    document.getElementById('frm').action = 'topicservlet?method=answer_add&forum_id= "+forum_id+ "&parent_id= "+topic_id';
    document.getElementById('frm').submit();
      

  2.   

    还是不行~~浏览器地址是变了http://localhost:8080/BBS/topicservlet?method=answer_add&forum_id=1&parent_id=1
    但是TopicServlet并没有接到请求,界面是空白
      

  3.   

    没有~~ 我在TopicServlet的doGet方法内System.out.println(method);
    但是并没有出现answer_add
    说明TopicServlet并没有接到请求~~
    纳闷了~~都提交了 怎么doGet的方法没反应呢?
    doPost()调用了doGet()方法了
      

  4.   

    Strcut没有拦截吧。空传值有什么用哈。
      

  5.   

    你servlet是以什么格式拦截的?  *.action  还是 *.do  还是/*  ?