O'Reilly logo

MySQL™ and JSP™ Web Applications: Data-Driven Programming Using Tomcat and MySQL by James Turner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing the Shopping Cart

With your products on display, you can start actually allowing people to buy them. To do this, you're going to need to implement a shopping cart. If you want, you can refer back to the design of the shopping cart in Chapter 4, “The Sample Application Functional Requirements Document.”

A cart is essentially a container that you can put products into, with a few quirks. For example, putting a second copy of an item into a cart shouldn't make two entries; it should make a single item with a quantity of 2.

The cart has session persistence, like the customer. Unlike the customer object however, it doesn't get its contents from a database lookup. Eventually, when you get to filling and spilling content in Chapter 11

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required