接上面的
<form action="default.jsp" method="post" name="shopcart">
<%
Books books=new Books();
Vector list=(Vector)session.getAttribute("buylist");
int i;
//int n;
//n=list.size();
//int shop_count[]=new int[n];
//int book_id[]=new int[n];
for(i=0;i<list.size();i++)
{ //循环显示购物车中的商品
books=(Books)list.elementAt(i);
String name=new String(books.booksname.getBytes("8859_1")); //获得书名
int id=books.books_id; //获得books id
double price=books.new_price; //获得单价
int num=books.numbers; //该类书的数量
double titalprice=num*price; //总价
%>
<tr>
<td align="center" class="main14" width="219" bgcolor="#ececec">
<font size="2"><%=name%>
</font></td>
<td align="center" class="main14" width="103" bgcolor="#ececec"> <font size="2">
<input type="hidden" name=book_id id=book_id value="<%=id%>">
<input type="text" size="4" name=book_count id=book_count value="<%=num%>"> 就在这里了 循环生成text 最上面接收提交的
<%}%>
</form>
<form action="default.jsp" method="post" name="shopcart">
<%
Books books=new Books();
Vector list=(Vector)session.getAttribute("buylist");
int i;
//int n;
//n=list.size();
//int shop_count[]=new int[n];
//int book_id[]=new int[n];
for(i=0;i<list.size();i++)
{ //循环显示购物车中的商品
books=(Books)list.elementAt(i);
String name=new String(books.booksname.getBytes("8859_1")); //获得书名
int id=books.books_id; //获得books id
double price=books.new_price; //获得单价
int num=books.numbers; //该类书的数量
double titalprice=num*price; //总价
%>
<tr>
<td align="center" class="main14" width="219" bgcolor="#ececec">
<font size="2"><%=name%>
</font></td>
<td align="center" class="main14" width="103" bgcolor="#ececec"> <font size="2">
<input type="hidden" name=book_id id=book_id value="<%=id%>">
<input type="text" size="4" name=book_count id=book_count value="<%=num%>"> 就在这里了 循环生成text 最上面接收提交的
<%}%>
</form>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货