as Lakshmeenarayana Goundalkar is trying to say
session.getValue is depricated (but it is working for now).
What you need to do in the code is to change this
-----------------------------
if
(command.equals("add"))
{
Integer num = (Integer) cart.get(id);
if (num == null) {
num = new Integer(0);
}
cart.put(id,new Integer(num.intValue()+1));
session.setAttribute("cart",cart);
//printCatalog(out, requestURI);
out.println("Item Added to Cart");
}
------------------------------------
this should add the cart with the new item in the session.