如何将一个jsp页面表单中的值传到另一个jsp页面的表单中?
例如jsp1.jsp中有一个连接“上传附件”,点击它会出来另一个页面jsp2.jsp,
在jsp2.jsp中有几个文件域,点击提交后,要将这几个值传到jsp1.jsp表单的隐藏域中
怎么写?
我这样写为什么传不过来?
jsp1.jsp
-----------------------------------------------------------------
<%
String attach1=request.getParameter("filepath1");
String attach2=request.getParameter("filepath2");
String attach3=request.getParameter("filepath3");
String attach4=request.getParameter("filepath4");
String attach5=request.getParameter("filepath5");
String attach6=request.getParameter("filepath6");
%>
<tr align="center" bgcolor="#F5F5E6">
<td colspan="3">
<input type="hidden" name="attach1" value="<%= attach1%>">
<input type="hidden" name="attach2" value="<%= attach2%>">
<input type="hidden" name="attach3" value="<%= attach3%>">
<input type="hidden" name="attach4" value="<%= attach4%>">
<input type="hidden" name="attach5" value="<%= attach5%>">
<input type="hidden" name="attach6" value="<%= attach6%>">
<input type="submit" name="Submit" value="提 交" class=button2>
<input type="reset" name="reset" value="重 置" class=button2>
</td>
</tr>
------------------------------------------------------------------------------------
jsp2.jsp
------------------------------------------------------------
<form action="jsp1.jsp" method="POST" enctype="multipart/form-data" name="form2" >
<table width="73%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#000000">
<tr bgcolor="#F5F5E6">
<td width="25%">附件1</td>
<td width="75%"><span class="text3">
<input type="file" name="filepath1">
</span></td>
</tr>
<tr>
<td bgcolor="#F5F5E6">附件2</td>
<td bgcolor="#F5F5E6"><span class="text3">
<input type="file" name="filepath2">
</span></td>
</tr>
<tr>
<td bgcolor="#F5F5E6">附件3</td>
<td bgcolor="#F5F5E6"><span class="text3">
<input type="file" name="filepath3">
</span></td>
</tr>
<tr>
<td bgcolor="#F5F5E6">附件4</td>
<td bgcolor="#F5F5E6"><span class="text3">
<input type="file" name="filepath4">
</span></td>
</tr>
<tr>
<td bgcolor="#F5F5E6">附件5</td>
<td bgcolor="#F5F5E6"><span class="text3">
<input type="file" name="filepath5">
</span></td>
</tr>
<tr>
<td bgcolor="#F5F5E6">附件6</td>
<td bgcolor="#F5F5E6"><span class="text3">
<input type="file" name="filepath6">
</span></td>
</tr>
<tr align="center" bgcolor="#F5F5E6">
<td colspan="2"><input type="submit" name="Submit" value="确定" class=button2>
<input type="reset" name="reset" value="重设" class=button2>
</td>
</tr>
</table>
</form>