Buying More Than One Thing at Once

Buying a single item is relatively straightforward because you can handle it directly from the URL. But the client wants the customer to be able to purchase several items at the same time.

Listing 10.7 shows a section of Category.jsp rewritten to let the customer buy a quantity of multiple books. It replaces the current product display loop.

Listing 10.7. Category.jsp Revisited
 <FORM METHOD="POST" ACTION="buyit.jsp" TARGET="tempwindow"> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber4" height="253"> <tr> <th width="38%" height="23" align="left">Title</th> <th width="23%" height="23" align="left">Author</th> <th width="11%" ...

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.