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函数的表单元素
//发表回帖
//判断输入内容是否为空,如果为空,不做处理,否则提交给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函数的表单元素
document.getElementById('frm').action = 'topicservlet?method=answer_add&forum_id= "+forum_id+ "&parent_id= "+topic_id';
document.getElementById('frm').submit();
但是TopicServlet并没有接到请求,界面是空白
但是并没有出现answer_add
说明TopicServlet并没有接到请求~~
纳闷了~~都提交了 怎么doGet的方法没反应呢?
doPost()调用了doGet()方法了