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

Displaying and Editing the Shopping Cart

The mini-cart is nice for a quick heads-up on what you've bought, but the customer will also want to be able to view and edit a more detailed version of the cart. So, it's time to implement the shopping cart page, shown in Listing 10.9.

Listing 10.9. shoppingcart.jsp
 <%@ page import="com.bfg.product.Product" %> <%@ page import="java.util.Iterator" %> <%@ page import="com.bfg.cart.Cart" %> <%@ page import="com.bfg.cart.CartItem" %> <jsp:useBean id="cart" class="com.bfg.cart.Cart" scope="session"/> <head> <title>Your Shopping Cart</title> </head> <%@ include file="/jsp/includes/bfgheader.jsp" %> <h2 align="center">Your Shopping Cart</h2> <FORM METHOD="POST" ACTION="changeit.jsp" TARGET="tempwindow"> <table ...

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