rivate boolean add(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
String id = req.getParameter("id");
int number = Integer.parseInt(req.getParameter("number"));
Items item = idao.getItemsById(Integer.parseInt(id));
if (req.getSession().getAttribute("cart") == null) {
Cart cart = new Cart();
req.getSession().setAttribute("cart", cart);
cart.addGoodsInCart(item, number);
} else {
Cart cart = (Cart) req.getSession().getAttribute("cart");
cart.addGoodsInCart(item, number);
}
return true;
}