我有一个名为generate.jsp的函数,它接受用户从GUI给出的输入time1和time2。
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<center> <table border="0">
<tr>
<td>
time1
</td>
<td>
<input type="text" id="time1" name="No"
</td>
</tr>
<tr>
<td>
time2
</td>
<td>
<input type="text" id="time2" name="No">
</td>
</tr>
<tr>
<td>
<input type="Submit" value="Submit" id="ok"
onclick="hello(id)"
>
</td>
</tr>
</table>
</body>
</html>
<script type="text/javascript">
function hello(id){
var t1=document.getElementById("time1").value;
var t2=document.getElementById("time2").value;
var newwindow =
parent.window.open("pdf.jsp?time1="+t1+"&time2="+t2);
window.close();
}
</script>
现在,这些输入传递给pdf.jsp,pdf.jsp具有以下代码来检索输入。
<% String time1= request.getParameter("time1");%>
<%String time2 = request.getParameter("time2");%>
因为,XML用于存储和传输数据,我想用它来传输数据,即。,time1和time2,从generate.jsp到pdf.jsp。我想在generate.jsp和pdf.jsp中使用XML代替JavaScript。可能吗。 如何转换它。