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

📄 shoppingcart.jsp

📁 一个Struts写的网上购物系统,是一个不错的实例.
💻 JSP
字号:
<%@ page contentType="text/html; charset=GB2312" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>

<html:html>
<head>
<title><bean:message key="global.title"/></title>
<html:base/>
</head>

<body topmargin="0" leftmargin="0" bgcolor="#FFFFFF">

<!-- Header Page Information -->
<%@ include file="../include/head.inc"%>

<!-- Nav Bar -->
<%@ include file="../include/menubar.inc"%>

<logic:lessEqual scope="session" name="SessionContainer" property="cart.size" value="0">
  <%@ include file="emptycart.jsp" %>
</logic:lessEqual>

<logic:greaterThan scope="session" name="SessionContainer" property="cart.size" value="0">  

  <TABLE cellSpacing=0 cellPadding=0 width=480 border=0>
        <TBODY>
        <TR>
          <TD vAlign=top width=20><IMG height=1 alt="" 
            src="../images/spacer.gif" width=20 
            border=0>
          </TD>
          <TD vAlign=top width=460>
          <!-- MAIN BODY CONTENT-->
          
      <form action="../action/cart?method=update" method="post">
            <TABLE width=460 border=0>
              <TBODY>
              <TR>
                <TD width=260 rowSpan=2><IMG height=20 alt="" 
                  src="../images/spacer.gif" width=1 
                  border=0><BR>
                  
                  <html:img height="35" page="/order/images/cart.gif"  border="0"/>
                  <IMG height=6 alt="" src="../images/spacer.gif" width=1 
                  border=0><BR></TD>
                <TD vAlign=bottom align=right width=200><FONT 
                   size=2>
                  <IMG height=9 alt="" src="Your BestBuy_com Shopping Cart_files/cart_leftarrow.gif" width=5 border=0>
                  <html:link page="/action/home"><bean:message key="shoppingcart.continue" /></html:link><BR><BR><BR></FONT></TD></TR></TBODY></TABLE>
                  
            <TABLE cellSpacing=0 cellPadding=3 width=460 border=0>             
              <TBODY>
              <!-- Header Row -->
              <TR bgColor=#cccccc>
                <TD noWrap><FONT  size=2<B><bean:message key="shoppingcart.delete" /></B></FONT></TD>
                <TD noWrap><FONT  size=2><B><bean:message key="shoppingcart.description" /></B></FONT></TD>
                <TD noWrap align=middle><FONT 
                  size=2><B><bean:message key="shoppingcart.qty" /></B></FONT></TD>
                <TD noWrap align=middle><FONT 
                  size=2><B><bean:message key="shoppingcart.price" /></B></FONT></TD>
                <TD noWrap align=middle><FONT 
                  size=2><B><bean:message key="shoppingcart.total" /></B></FONT></TD></TR>
              <!-- /Header Row -->
                                                       
              
              <logic:iterate id="cartItem" scope="session" name="SessionContainer" property="cart.items">
              
              <!-- Item row -->
              <TR bgColor=#ffffff>
                
                <!--Delete checkbox for item -->
                <TD vAlign=top align=middle>
                 <input type="checkbox" value="<bean:write name="cartItem" property="id"/>" name="deleteCartItem"></td>
                
                <!-- name and description for item -->
                <TD vAlign=top align=left><FONT 
                   size=2><B>
                  
                  <html:link page="/action/viewitemdetail" paramName="cartItem" paramId="id" paramProperty="id">
                    <bean:write name="cartItem" property="name"/>
                  </html:link>
                  </B><BR><bean:message key="shoppingcart.instock" />   
                  
                  <BR><bean:message key="shoppingcart.shippingtime" /><BR></FONT></TD>
                 
                <!-- Qty input box -->
                <TD vAlign=top noWrap align=middle>
                  <input type="maxlength="3" size="3" text name="qty_<bean:write name="cartItem" property="id"/>" value="<bean:write name="cartItem" property="quantity"/>">                  
                </TD>
                 
                <!-- Unit price for item -->
                <TD vAlign=top noWrap align=middle><FONT 
                   size=2><B>$<bean:write name="cartItem" format="#,##0.00" property="unitPrice"/><BR></B></FONT></TD>
                  
                <!-- Extended price for item -->
                <TD vAlign=top align=right>
                  <TABLE cellSpacing=2 cellPadding=3 width="100%" border=0>
                    <TBODY>
                    <TR>
                      <TD align=right bgColor=#ffcc00><FONT 
                         size=2><B>$<bean:write name="cartItem" format="#,##0.00" property="extendedPrice"/><BR></B></FONT>
                      </TD>
                    </TR>
                   </TBODY>
                  </TABLE>
                 </TD>                 
                 
                </TR>    
                
              </logic:iterate>          
              
              <TR>
                <TD colSpan=5>
                  <TABLE cellSpacing=0 cellPadding=0 width="100%" 
                  bgColor=#cccccc>
                    <TBODY>
                    <TR>
                      <TD><IMG height=1 alt="" src="../images/spacer.gif" width=1 border=0></TD></TR></TBODY></TABLE></TD>
                    </TR>
                <!-- /Grey Separator Row -->
                
              </TBODY></TABLE></TD>
             </TR>
            
              <!-- End Of Items -->
              
              
              <INPUT type=hidden value=1 name=ShowItemNum>
              
              <!-- Ending Separator Row -->
              <TR>
                <TD colSpan=5>
                  <TABLE cellSpacing=0 cellPadding=0 width="100%" 
                  bgColor=#cccccc border=0>
                    <TBODY>
                    </TBODY></TABLE></TD></TR><!-- /Ending Separator Row -->
                    
                  
              <TR>
                <TD colSpan=5>
                  <TABLE cellSpacing=0 cellPadding=0 width="100%" 
                  bgColor=#c0c0c0 border=1>
                    <TBODY>
                    <TR>
                      <TD align=left width=107>
                       
                       <html:image  page="/order/images/deleteitems.gif" border="0"/></TD>
                      <TD align=left width=131><IMG height=1 alt="" 
                        src="../images/spacer.gif" 
                        width=131 border=0></TD>
                      <TD align=right width=66>
                      
                       <html:image  page="/order/images/updateqty.gif" border="0"/></TD>
                      <TD vAlign=center align=right width=150 
                        bgColor=#ffffff><FONT  
                        size=2><B><bean:message key="shoppingcart.total" />* $<bean:write scope="session" format="#,##0.00" name="SessionContainer" property="cart.totalPrice"/>
                        <IMG height=1 alt="" 
                        src="../images/spacer.gif" 
                        width=3 
                border=0></B></FONT></TD></TR></TBODY></TABLE></TD>
              <TR>
                <TD align=right colSpan=5>                
                  <TABLE cellSpacing=0 cellPadding=0 width=186 border=0>
                    <TBODY>
                    <TR>
                      <TD vAlign=top width=93>
                        <html:link page="/action/home">
                          <html:img  page="/order/images/continueshopping.gif" border="0"/>
                        </html:link>
                       </TD>
                      <TD vAlign=top width=93>
                        <html:link page="/action/begincheckout">
                          <html:img  page="/order/images/checkout.gif" border="0"/>
                        </html:link>
                      </TD></TR></TBODY></TABLE></TD></TR>
              <TR>
                <TD colSpan=5>
                  <TABLE cellSpacing=0 cellPadding=0 width="100%" 
                  bgColor=#cccccc>
                    <TBODY>
                    <TR>
                      <TD><IMG height=1 alt="" 
                        src="../images/spacer.gif" 
                        width=1 border=0></TD></TR></TBODY></TABLE></TD></TR><!-- /Grey Separator Row --><!-- Disclaimers Row -->
              <TR>
                <TD align=right colSpan=5>
                  <TABLE cellSpacing=0 cellPadding=0>
                    <TBODY>
                    <TR>
                      <TD><FONT  
                        size=2><B><bean:message key="shoppingcart.note" />   </B></FONT></TD></TR></TBODY></TABLE></TD></TR><!-- /Disclaimers Row --><!-- /Buy Pallet --></TBODY></TABLE><BR>
            <DIV class=body-text align=center>
            <TABLE cellSpacing=0 cellPadding=0 width="100%">
              <TBODY>
              <TR>
                <TD bgColor=#cccccc><IMG height=1 alt="" 
                  src="../images/spacer.gif" width=1 
                  border=0></TD>
                <TD><IMG height=1 alt="" 
                  src="../images/spacer.gif" width=5 
                  border=0></TD>
                <TD bgColor=#cccccc><IMG height=1 alt="" 
                  src="../images/spacer.gif" width=1 
                  border=0></TD>
                <TD><IMG height=1 alt="" 
                  src="../images/spacer.gif" width=5 
                  border=0></TD>
                <TD bgColor=#cccccc><IMG height=1 alt="" 
                  src="../images/spacer.gif" width=1 
                  border=0></TD></TR>
              <TR>
                <TD vAlign=top align=middle>
                  <TABLE cellSpacing=0 cellPadding=0 width=150 
                    bgColor=#ffffcc><TBODY>
                   </TBODY></TABLE></TD>
                <TD><IMG height=1 alt="" 
                  src="../images/spacer.gif" width=5 
                  border=0></TD>
                <TD vAlign=top align=middle>
                  <TABLE cellSpacing=0 cellPadding=0 width=150 
                    bgColor=#ffffcc><TBODY>
                    </TBODY></TABLE></TD>
                <TD><IMG height=1 alt="" 
                  src="../images/spacer.gif" width=5 
                  border=0></TD>
                <TD vAlign=top align=middle>
                  <TABLE cellSpacing=0 cellPadding=0 width=150 
                    bgColor=#ffffcc><TBODY>
                   </TBODY></TABLE></TD></TR></TBODY></TABLE>
            
            
            </TD></TR></TBODY></TABLE></FORM>
                  </td>
                  </tr>
                  </tbody>
                  </table>

</logic:greaterThan>

<%@ include file="../include/copyright.inc"%>
</body>


</html:html>



⌨️ 快捷键说明

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