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);
}
%>
You have the following items in your cart:
Shopcar c=(Shopcar)session.getAttribute("shopcar");
Object [] a =c.show();
Good g;
for (int i=0; i g=(Good)a[i];
%>
name: count:
}
%>
continue shopping
edit my shopcar