📄 showcart.jsp
字号:
<%@ page contentType="text/html; charset=GB2312" %>
<%@ page import="com.ascenttech.ebookstore.bean.*"%>
<%@ page import="com.ascenttech.ebookstore.shopcart.*"%>
<%@ page import="java.util.*"%>
<html>
<head>
<title>
购物车
</title>
<link href="css/mycss.css" rel="stylesheet" type="text/css" />
</head>
<body leftmargin=0 topmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
<div class="top"></div>
<div class="main1"></div>
<div class="main2"><center>
<h1> </h1>
<span class="bodyh1">这是购物车 您买的书是: </span>
<table border=1>
<tr>
<td class="bodytxt">ISBN</td>
<td class="bodytxt">书名</td>
<td class="bodytxt">作者</td>
<td class="bodytxt">价格</td>
<td class="bodytxt">数量</td>
</tr>
<%
String user = (String) session.getAttribute("username");
ShoppingCart bookmap=(ShoppingCart) session.getAttribute(user);
%>
<span class="bodyh1">Total is: <%=bookmap.getTotal()%>
Number is: <%=bookmap.getNumberOfItems()%></span>
<%
Collection bookisdns = bookmap.getItems();
Iterator it1=bookisdns.iterator();
while(it1.hasNext()){
ShoppingCartItem sitem = (ShoppingCartItem)it1.next();
BookDetails item = (BookDetails)sitem.getItem();
%>
<tr>
<td><%=item.getIsbn()%></td>
<td><%=item.getTitle()%></td>
<td><%=item.getAuthor()%></td>
<td><%=item.getPrice()%></td>
<td><%=sitem.getQuantity()%></td>
<td><a href="shoppingcart?operation=removeItem&isdn=<%=item.getIsbn()%>">删除此书</a></td>
</tr>
<%
}
%>
<a href="<%=request.getContextPath()%>/orderdeal.jsp">确认购买</a>
<a href="javascript:history.back()">继续购物</a>
</table></center>
<div class="txt">版权所有:亚思晟科技(C)2005-2008</div>
</div>
<div class="main3"></div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -