传递多种物品
源代码在线查看: edit.jsp
软件大小: |
5 K |
上传用户: |
yl810406 |
|
|
关键词: |
|
下载地址: |
免注册下载 普通下载
|
|
request.setCharacterEncoding("GBK");
if(request.getParameter("item")!=null && !"".equals(request.getParameter("mount")) ){
Good g=new Good();
g.setName(request.getParameter("item"));
g.setMount(Integer.parseInt(request.getParameter("mount")));
Shopcar car=(Shopcar)session.getAttribute("shopcar");
if(car==null) {
car=new Shopcar();
}
car.addGood(g);
session.setAttribute("shopcar",car);
}
%>
Shopcar c=(Shopcar)session.getAttribute("shopcar");
Object [] a =c.show();
Good g;
for (int i=0; i g=(Good)a[i];
%>
}
%>
增加的数量(可以为负):
continue shopping
show my shop car