+ "</TH>" + "<th align=left>"
+ messages.getString("ItemPrice") + "</TH>" + "</tr>");
Iterator i = cart.getItems()
.iterator();
Currency c = (Currency) session.getAttribute("currency");
if (c == null) {
c = new Currency();
c.setLocale(request.getLocale());
session.setAttribute("currency", c);
}
while (i.hasNext()) {
ShoppingCartItem item = (ShoppingCartItem) i.next();
bd = (Book) item.getItem();
c.setAmount(bd.getPrice());
out.println(
"<tr>" + "<td align=\"right\" bgcolor=\"#ffffff\">"
+ item.getQuantity() + "</td>"
+ "<td bgcolor=\"#ffffaa\">" + "<strong><a href=\""
+ response.encodeURL(
request.getContextPath()
+ "/bookdetails?bookId=" + bd.getBookId())
+ "\">" + bd.getTitle() + "</a></strong>" + "</td>"
+ "<td bgcolor=\"#ffffaa\" align=\"right\">"
+ c.getFormat() + "</td>" + "<td bgcolor=\"#ffffaa\">"
+ "<strong>" + "<a href=\""
+ response.encodeURL(
request.getContextPath()
+ "/bookshowcart?Remove=" + bd.getBookId())
+ "\">" + messages.getString("RemoveItem")
+ "</a></strong>" + "</td></tr>");
}
c.setAmount(cart.getTotal());
// Print the total at the bottom of the table
out.println(
"<tr><td colspan=\"5\" bgcolor=\"#ffffff\">"
+ "<br></td></tr>" + "<tr>"
+ "<td colspan=\"2\" align=\"right\""
+ "bgcolor=\"#ffffff\">" + messages.getString("Subtotal")
+ "</td>" + "<td bgcolor=\"#ffffaa\" align=\"right\">"
+ c.getFormat() + "</td>"
+ "</td><td><br></td></tr></table>");
// Where to go and what to do next
out.println(
"<p> <p><strong><a href=\""