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>
-------------------------------------------------------
控制台 显示结果(正常,只输出一次)
------------
其他浏览器都正常
建议你用脚本的方式吧!
<a href="javascript:openPath('TTServlet?infs=23424')">删除</a>
function openPath(path){
window.localhost.href=path;
}
function openPath(path){
window.location.href=path;
}
<a href="javascript:openPath('TTServlet?infs=23424')">删除</a>