📄 showcart.txt
字号:
<%-- Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. This software is the proprietary information of Sun Microsystems, Inc. Use is subject to license terms. --%><%@ taglib uri="/struts-bean" prefix="bean" %><%@ taglib uri="/struts-logic" prefix="logic" %><%@ include file="initdestroy.jsp" %><jsp:useBean id="currency" class="util.Currency" scope="application"> <jsp:setProperty name="currency" property="locale" value="<%=request.getLocale()%>"/></jsp:useBean><jsp:useBean id="cart" class="cart.ShoppingCart" scope="session"/><logic:present parameter="Remove"> <bean:parameter id="bookId" name="Remove" /> <% cart.remove(bookId); %> <jsp:setProperty name="bookDB" property="bookId" value="<%=bookId%>" /> <bean:define id="book" name="bookDB" property="bookDetails" type="database.BookDetails"/> <font color="red" size="+2">You just removed: <em><jsp:getProperty name="book" property="title"/></em> <br> <br> </font></logic:present><logic:present parameter="Clear"> <% cart.clear(); %> <font color="red" size="+2"><strong> You just cleared your shopping cart! </strong><br> <br></font></logic:present><bean:define id="num" name="cart" property="numberOfItems" /><logic:greaterThan name="num" value="0" > <font size="+2">You have <%=num%> <logic:equal name="num" value="1"> item </logic:equal> <logic:greaterThan name="num" value="1"> items </logic:greaterThan> in your shopping cart. </font><br> <table> <tr> <th align=left>Quantity</TH> <th align=left>Title</TH> <th align=left>Price</TH> </tr> <logic:iterate name="cart" property="items" id="item" type="cart.ShoppingCartItem"> <bean:define id="book" name="item" property="item" type="database.BookDetails"/> <bean:define id="bookId" name="book" property="bookId" type="java.lang.String"/> <tr> <td align="right" bgcolor="#ffffff"> <jsp:getProperty name="item" property="quantity" /> </td> <td bgcolor="#ffffaa"> <strong><a href="<%=request.getContextPath()%>/bookdetails?bookId=<%=bookId%>"><jsp:getProperty name="book" property="title"/></a></strong> </td> <td bgcolor="#ffffaa" align="right"> <jsp:setProperty name="currency" property="amount" value="<%=book.getPrice()%>"/> <jsp:getProperty name="currency" property="format"/> </td> </td> <td bgcolor="#ffffaa"> <strong><a href="<%=request.getContextPath()%>/showcart?Remove=<%=bookId%>">Remove Item</a></strong> </td></tr> </logic:iterate> <tr><td colspan="5" bgcolor="#ffffff"> <br></td></tr> <tr> <td colspan="2" align="right" "bgcolor="#ffffff"> Subtotal:</td> <td bgcolor="#ffffaa" align="right"> <jsp:setProperty name="currency" property="amount" value="<%=cart.getTotal()%>"/> <jsp:getProperty name="currency" property="format"/> </td> </td><td><br></td></tr></table> <p> <p> <strong><a href="<%=request.getContextPath()%>/catalog">Continue Shopping</a> <a href="<%=request.getContextPath()%>/cashier">Check Out</a> <a href="<%=request.getContextPath()%>/showcart?Clear=clear">Clear Cart</a></strong></logic:greaterThan><logic:lessEqual name="num" value="0" > <font size="+2">There is nothing in your shopping cart.</font> <br> <br> <strong><a href="<%=request.getContextPath()%>/catalog">Back to the Catalog</a></strong></logic:lessEqual></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -