Example: Session
HttpSession session = request.getSession(true);
ShoppingCart previousItems = (ShoppingCart)session.getValue("previousItems");
if (previousItems != null) { doSomethingWith(previousItems);
previousItems = new ShoppingCart(...); doSomethingElseWith(previousItems);
- These session objects have a builtin data structure that let you store any number of keys and associated values