J2EE: How to remove contents of Http Session
You can remove contents of a HttpSession by calling removeAttribute() method. for example
request.getSession().removeAttribute("cart"); -- removes item cart from HttpSession
1 more way is to call getAttribute() and then calling the clear() on map.
request.getSession().getAttribute("cart").clear();
request.getSession().removeAttribute("cart"); -- removes item cart from HttpSession
1 more way is to call getAttribute() and then calling the clear() on map.
request.getSession().getAttribute("cart").clear();
Comments
Post a Comment