标签:style blog io ar color sp java for on
Buy.jsp
//修改购物车商品的数量 if (action != null && action.equals("update")) { Iterator<CartItem> it = c.getItems().iterator(); while (it.hasNext()) { CartItem item = it.next(); int count = Integer.parseInt(request.getParameter("p" + item.getProduct().getPid())); item.setCount(count); } } <form action="Buy.jsp" method="get"> <input type="hidden" name="action" value="update" /> ... <td> <input type="text" name="<%="p" + ci.getProduct().getPid()%>" value="<%=ci.getCount()%>" size="3" /><!--每个购物项的数量文本框--> </td> ... <td colspan="7"> <a href="Confirm.jsp">下单</a> <a href="javascript:document.forms[0].submit()">修改</a> </td><!--采用链接的方式提交表单-->
标签:style blog io ar color sp java for on
原文地址:http://www.cnblogs.com/beast-king/p/4142307.html