Java Reference
In-Depth Information
L ISTING 20.7
Continued
<td colspan=”2”><%@ include file=”titlebar.jsp” %></td>
</tr>
<tr>
<td width=”75” valign=”top”><%@ include file=”navigation.jsp” %></td>
<td valign=”top”>
<table align=”top” width=”600” cellspacing=”0” cellpadding=”2” border=”0”>
<caption><b>Shopping Cart Contents</b></caption>
<tr>
<th align=”left”>Description</th>
<th>Price</th>
<th>Quantity</th>
</tr>
<%
Enumeration enum = cart.getEnumeration();
String[] tmpItem;
// Iterate over the cart
while (enum.hasMoreElements()) {
tmpItem = (String[])enum.nextElement();
%>
<tr>
<td><%=tmpItem[1] %></td>
<td align=”center”>$<%=tmpItem[2] %></td>
<td align=”center”><%=tmpItem[3] %></td>
</tr>
<%
}
%>
</table>
</body>
</html>
Check Out View
The Check Out view will be represented by the file CheckOut.jsp . It will empty the shopping
cart and respond with a thank you message. An image of the Check Out view is in Figure 20.7.
Search WWH ::




Custom Search