我想知道如何将数组或列表从一个 .jsp 页面传递到另一个页面。然后我想从这个数组中获取值并将它们分配给一个 javascript 数组。我想我已经正确配置了源 jsp 页面,但想知道如何获取第二个 .jsp 页面中的值。
这是我的源 .jsp 文件:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Firstjsp</title>
</head>
<body>
<Form Method = "Post" Action = "Mapper.jsp">
<% String locations[] = {"Loan 1", "33.890542", "151.274856", "Address 1","true", "-35404.34"};
for (int i =0; i<locations.length; i++)
{
%>
<Input type = "Hidden" name = "loc" value = "<%= locations[i] %>">
<%
}
%>
</Form>
</body>
</html>