Skip to main content

Mini Project: Shopping Cart in the HTTP Session

Learn Mini Project: Shopping Cart in the HTTP Session (Session Management, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Mini Real-Time Project: Shopping Cart in the HTTP Session Problem A shopping cart must survive between requests of the same visitor but stay separate for different visitors, and disappear on logout or timeout. Compare three ways to keep it in the session. Requirements Use HttpSession directly. Use @SessionAttributes on the controller. Use a session-scoped bean injected into a singleton controller. Show two visitors do not share carts, and the cart is gone after invalidation. Concepts Used HttpSession @SessionAttributes / SessionStatus @Scope("session") bean with a scoped proxy session timeout...

More lessons in Session Management