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

📄 shoppingcart.jsp

📁 《J2EE企业级应用开发》一书的配套源代码
💻 JSP
字号:
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%@ page contentType="text/html;charset=gb2312"%> 
<%@ page import="com.j2ee.internetbeans.*,com.j2ee.dx.dataset.*,com.j2ee.dx.sql.dataset.*" errorPage="error.jsp" %>
<%@ taglib uri="/internetbeans.tld" prefix="ix" %><head>
<title>J2EE企业级应用开发 </title>

<jsp:include page="header.jsp" flush="true"/>
<jsp:include page="sidebar.jsp" flush="true"/>
<jsp:useBean id="shoppingSession" scope="session" class="com.j2eeapp.cdstore.bean.ShoppingSession" />

  
<IMG height=35 alt="" src="images/shopping_cartbanner.gif" width=160 border=0><br>
  <%
  pageContext.setAttribute("shoppingCart", shoppingSession.getClientDataModule().getShoppingCartDataSet());
  shoppingSession.getClientDataModule().provideAllData(null, shoppingSession.getUserId());
  %>
  <ix:table id = "list" dataSet = "shoppingCart">
  <%
    IxButtonFormCell ixButtonFormCell = new IxButtonFormCell();
    ixButtonFormCell.setAction("removeitem");
    ixButtonFormCell.setHiddenControlName("inventoryid");
    ixButtonFormCell.setButtonText("Remove from cart"); // Appears as alt text if executed before setButtonImage()
    ixButtonFormCell.setButtonImage("images/remove.gif");
    list.setDefaultRenderer("Inventory.Id", ixButtonFormCell);
    list.getColumnNameMap().put("Book Title", "Inventory.BookTitle");
    list.getColumnNameMap().put("Price", "Inventory.Price");
    list.getColumnNameMap().put("", "Inventory.Id");
  %>
   <table border="0" cellspacing="0" cellpadding="2" width="500">

   <tr>
   <th background="images/titlebar_stretch.gif" valign="top" class="title" align="left">名称</th>
   <th background="images/titlebar_stretch.gif" align="right" valign="center" class="title">价格</th>
   <th background="images/titlebar_stretch.gif" align="right" valign="center" class="title"></th>
   <th background="images/titlebar_stretch.gif" align="right" valign="center" class="title"></th>
   </tr>

   <tr>
   <td><a href="" class="heading">Web Application Development</a></td>
   <td align="right">$5.95</td>
   <td align="right">2</td>
   <td>Remove</td>
<%--
   <td align="right">
     <table border="0" cellspacing="0" cellpadding="0">
       <tr>
       <td><IMG height=15 alt="" src="images/cart.gif" width=18 border=0></td>
       <td><IMG height=18 alt="" src="images/addbar_left.gif" width=6 border=0></td>
       <td background="images/addbar_stretch.gif" class="subtitle">Remove</td>
       <td><IMG height=18 alt="" src="images/addbar_right.gif" width=6 border=0></td>
       </tr>
     </table></td>
--%>
   </tr>
   </table>
   </ix:table>
  <%
  int rowCount = shoppingSession.getClientDataModule().getShoppingCartDataSet().getRowCount();
  if ( rowCount > 0 && shoppingSession.isLoggedIn() ) {
  %>
  <form method="post" action="checkout">
  <input type="submit" value="Check Out">
  </form>
  <%
  } else if ( rowCount > 0 && !shoppingSession.isLoggedIn() ) {
  %>
  <i>You must <a href="loginform">log in</a> before you can purchase the items in your shopping cart</i>
  <%
  } else {
  %>
  <i>There are no items in your shopping cart</i>
  <%
  }
  %>
<jsp:include page="Footer.jsp" flush="true"/>

⌨️ 快捷键说明

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