我想用 href 而不是按钮传递输入数据。问题是我正在发送一个数组,我的 for 循环正在存储输入数据,因此它创建了多个链接。采取什么行动来解决这个问题。
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Firstjsp</title>
</head>
<body>
<% String locations[] = {"Loan 1", "33.890542", "151.274856", "Address 1","true", "-35404.34"};
for (int i =0; i<locations.length; i++)
{
%>
<form name="submitForm" method="POST" action="Mapper.jsp">
<Input type = "Hidden" name = "loc" value = "<%= locations[i] %>">
<A HREF="Mapper.jsp">View Map</A>
</form>
<%
}
%>
</body>
</html>