【文件属性】:
文件名称:基于servlet的购物车
文件大小:16KB
文件格式:ZIP
更新时间:2016-07-28 16:46:33
购物车
//得到书号和书本对象
int bookid =Integer.parseInt(request.getParameter("id"));
Map books = (Map)request.getSession().getServletContext().getAttribute("books");
Book book = books.get(bookid);
System.out.println(book);
//得到数量
int bookNum = Integer.parseInt(request.getParameter(String.valueOf(bookid)));
System.out.println(bookNum);
//封装成line对象
Line line = new Line(book, bookNum);
System.out.println(line);
ListBookStoreServiceImpl listBSSer = new ListBookStoreServiceImpl();
ShoppingCart obj = (ShoppingCart)request.getSession().getAttribute("shoppingCart");
ShoppingCart SC = listBSSer.getShoppingCart(obj,line);
//保存到Session范围
request.getSession().setAttribute("shoppingCart", SC);
// System.out.println("SESSION===================>"+request.getSession().getAttribute("shoppingCart"));
request.getRequestDispatcher("listcart.jsp").forward(request, response);
【文件预览】:
WebContent
----JS()
--------listcart.js(922B)
--------ListBookStore.js(563B)
----ListBookStore.jsp(1KB)
----WEB-INF()
--------web.xml(2KB)
----confirm.jsp(1KB)
----listcart.jsp(2KB)
resources
----qwe.sql(327B)
----ShoppingCart基本流程.txt(876B)
src
----org()
--------esun()