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 ... |
Get MySQL™ and JSP™ Web Applications: Data-Driven Programming Using Tomcat and MySQL now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.