FileDocCategorySizeDatePackage
EmptyCartServlet.javaAPI DocExample1235Wed Apr 05 20:05:26 BST 2006com.oreilly.ajax.servlet

EmptyCartServlet

public class EmptyCartServlet extends HttpServlet

Fields Summary
private static final long
serialVersionUID
Constructors Summary
Methods Summary
public voiddoGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)


         
              

    
        res.setContentType("text/xml");
        res.setHeader("Cache-Control", "no-cache");

        User user = (User) req.getSession().getAttribute("user");
        if (user != null)
        {

            ShoppingCartManager.emptyShoppingCart(user);
            String responseString = ShoppingCartManager
                    .getJSONShoppingCart(user);
            res.getWriter().write(responseString);
        }
        else
            res.getWriter().write("fail");