⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 showquote.jsp

📁 JAVA 光盘操作说明 是解压包,直接解压就可以了
💻 JSP
字号:
<%-- 本JSP显示加入购书车的图书的详细信息
--%>
<%@ page contentType="text/html; charset=GBK" %> 
<HTML>
    <head><title> 购书车信息 </title></head>
    <body>
        <jsp:include page="title.jsp" />
	<jsp:directive.page errorPage="error.jsp" />
        <%@ page import="examples.BookItem" %>
        <%@ page import="examples.LineItem" %>
        <%@ page import="java.text.NumberFormat" %>
        <form action="/BookStore/showQuote" method="get"> 
                <center><table>
                    <tr>
			<th align=left> 图书名称 </TH>
			<th align=left> 数量 </TH>
			<th align=left> 单价 </TH>
			<th align=left> 折扣 </TH>
			<th align=left><strong> 总价 </strong></TH>
			<th align=left>修改数量</TH>
                    </tr>
                    <%
                    // 获取购书车明细项信息并显示
                    Enumeration lineItems = ((Vector) request.getAttribute("lineItems")).elements();
                    double subTotal=((Double)request.getAttribute("subTotal")).doubleValue();
                    double taxes=((Double)request.getAttribute("taxes")).doubleValue();
                    double total=((Double)request.getAttribute("total")).doubleValue();
   
                    while (lineItems.hasMoreElements()) {
                        LineItem li = (LineItem) lineItems.nextElement();
                        int quantity     = li.getQuantity();
                        double discount  = li.getDiscount();
                        BookItem book  = li.getBookItem();
                        String bookID = book.getBookID();
                        double basePrice = book.getBasePrice();
                    %>
                    <tr>
                        <td bgcolor="#ffffaa"><a href="/BookStore/catalog?bookId=<%=book.getBookID()%>"><b><%=book.getName()%><b></td>
                        <td align="right" bgcolor="#ffffff"><%=quantity%></td>
                        <td bgcolor="#ffffaa" align="right"><%=NumberFormat.getCurrencyInstance().format(basePrice)%></td>
                        <td bgcolor="#ffffaa" align="right"><%=NumberFormat.getCurrencyInstance().format(discount)%></td>
                        <td bgcolor="#ffffaa" align="right"><%=NumberFormat.getCurrencyInstance().format((basePrice* quantity) - discount )%></td>
                        <td><input type="text" name="<%=bookID%>" value="<%=quantity%>"></td>
                    </tr>
                    <% } %>
                </table></center>
                <br>
                <center><table>
                    <tr>
                        <td colspan="2" align="right" bgcolor="#ffffff"> 总计:</td>
                        <td bgcolor="#ffffaa" align="right"> <%=NumberFormat.getCurrencyInstance().format(subTotal)%></td>
                        <td> <br></td>          
                    </tr>
                    <tr>
                        <td colspan="2" align="right" bgcolor="#ffffff"> 税额: </td>
                        <td bgcolor="#ffffaa" align="right"><%=NumberFormat.getCurrencyInstance().format(taxes)%></td>
                        <td><br></td>
                    </tr>
                    <tr>
                        <td colspan="2" align="right" bgcolor="ffffff"> <font color="ff0000"> <strong>税后总计:</strong></font> </td>
                        <td bgcolor="#ffffaa" align="right"><%=NumberFormat.getCurrencyInstance().format(total)%></td>
                        <td><br></td>   
                    </tr>
                </table></center>
                <!--
                    显示交互按钮
                //-->
                <p>
                <A href="/BookStore/catalog">查看图书目录</A>
                <input type="reset" value="重置数值"> &nbsp; &nbsp; &nbsp;
                <input type="submit" name="Update" value="修改数量"> &nbsp; &nbsp; &nbsp;
                <input type="submit" name="Order" value="提交订单"> &nbsp; &nbsp; &nbsp;
                <input type="submit" name="Clear" value="清空购书车"> &nbsp; &nbsp; &nbsp;
        </form>
    </body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -