%--
Copyright 2001 Sun Microsystems, Inc. All Rights Reserved.
This software is the proprietary information of Sun Microsystems, Inc.
Use is subject to license terms.
--%>
<%@ include file="initdestroy.jsp" %>
<%@ page import="java.util.*" %>
Book Catalog
<%@ include file="banner.jsp" %>
<%
// Additions to the shopping cart
String bookId = request.getParameter("Add");
if (bookId != null) {
bookDB.setBookId(bookId);
BookDetails book = bookDB.getBookDetails();
cart.add(bookId, book);
%>
You just added <%=book.getTitle()%> to your shopping cart.
<%
}
if (cart.getNumberOfItems() > 0) {
%>
Check Shopping Cart
Buy Your Books
<%
}
%>
Please choose from our selections:
<%
Collection c = bookDB.getBooks();
Iterator i = c.iterator();
while (i.hasNext()) {
BookDetails book = (BookDetails)i.next();
bookId = book.getBookId();
%>
<%=book.getTitle()%> |
<%=currency.getFormat()%>
|
Add to Cart |
by <%=book.getFirstName()%>
<%=book.getSurname()%> |
<% } %>