超链接 从jsp提交到servlet 两次重复提交

Frifox 23.1 下带参超链接 从jsp提交到servlet 结果显示两次提交
如果不带参数就正常提交一次、

a.jsp
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
<a href="TTServlet?infs=23424">删除</a>
</body>
</html>
------------------------------------------------
TTServlet.java
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {

doPost(request, response);
}

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

System.out.println("------------");
}
-------------------------------------------------------
控制台 显示结果
------------
------------

-------------------------------------------------------
吧超链接改为:(去掉参数)
<a href="TTServlet">删除</a>
-------------------------------------------------------
控制台 显示结果(正常,只输出一次)
------------

其他浏览器都正常、
大神们帮我看看是哪里问题、 我都找了一个上午了、
最新回答
无恙

2024-09-05 04:35:30

如果表单使用post传送的就用dopost,用get传送就用doget,我们一般把方法写在一个里面比如dogetw然后在dopost中写this.doget(request,response),这样如果运行dopost,它也会跳转到doget中的8122