res.setContentType("text/xml");
res.setHeader("Cache-Control", "no-cache");
String username = req.getParameter("username");
String password = req.getParameter("password");
if (username != null && password != null)
{
User user = UserManager.login(username,password);
if (user!=null)
{
String responseString = ShoppingCartManager.getJSONShoppingCart(user);
HttpSession session = req.getSession();
session.setAttribute("user",user);
res.getWriter().write(responseString);
}
else
res.getWriter().write("fail");
}
else
res.getWriter().write("fail");