有两个页面A.jsp,B.jsp,A.jsp是显示的,内容是从数据库中查出的数据,做了个一个表单,记录是动态生成,每条记录前都有一个复选框,然后在点击“提交”按钮的时候,需要将A.jsp已经被打“√”的记录传递到页面B.jsp中,然后在B.jsp中得到这些记录并进行数据库的插入操作。
A.jsp:建立一个form表单,
<form action="B.jsp" mgethod="post" name="form1" >
<div id="Layer5" style="position:absolute; width:100%; height:304px; z-index:3; left: 0px; top: 43px;">
<div id="Layer1" style="position:absolute; width:100%; height:261px; left: 0px; top: 0px; overflow: auto; visibility: visible;">
<table width="97%" border="1" bordercolor="#FFFFFF">
<%
while(rs.next())
{
i++;
a1=rs.getString(1).trim();
a2=rs.getString(2).trim();
a3=rs.getString(3).trim();
%>
<tr bordercolor="#004080">
<td width="5%" nowrap>
<div align="center" class="style4 style7 style8"><%=i%></div></td>
<td width="8%"><div align="center">
<input name="checkbox231" type="checkbox" value="1" checked>
</div></td>
<td width="52%" >
<div align="left" class="style4"><%=a1%></div></td>
<td width="14%" nowrap>
<div align="center" class="style8"><%=a2%>
</div></td>
<td width="14%" nowrap>
<div align="right" class="style4">
<p align="center"><%=a3%></p>
</div></td>
</tr>
<%}
rs.close();%>
</table>
</div>
<div id="Layer2" style="position:absolute; width:100%; height:35px; z-index:5; top: 268px;">
<table width="100%">
<tr>
<td><div align="center">
<input name="Submit" type="submit" class="style8" value=" 提交 ">
</div></td>
<td><div align="center">
<input name="Submit2" type="reset" class="style8" value=" 清空 ">
</div></td>
</tr>
</table>
</div>
</div>
</form>
然后在B页面中怎么得到A页面传递的数值,并将A页面中的a1,a2,a3的值传递到B页面的b1,b2,b3中,
是有很多条a1a2a3的记录,我用的是页面直接打开数据库的方式,
请问A页面我需要怎么改,然后在B页面怎么得到这些记录并写到数据库中,初学者,请给个详细的代码,可用后再追加