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

📄 mycart.jsp

📁 一个jsp的课程设计:电子商务网站
💻 JSP
字号:
<%@page contentType="text/html"%><%@page pageEncoding="UTF-8" import="cart.cartInfo"%><%--The taglib directive below imports the JSTL library. If you uncomment it,you must also add the JSTL library to the project. The Add Library... actionon Libraries node in Projects view can be used to add the JSTL 1.1 library.--%><%--<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> --%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"   "http://www.w3.org/TR/html4/loose.dtd"><jsp:useBean id="room" class="dbpack.room" scope="page" /><jsp:useBean id="type" class="dbpack.type" scope="page" /><jsp:useBean id="login" class="dbpack.Login" scope="session" /><%    if(!login.getIsLogin()){        response.sendRedirect("index.jsp");    }    %>}<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>我的购物车</title><style type="text/css"><!--body,td,th {	font-size: 9pt;}body {	margin-left: 0px;	margin-top: 0px;	margin-right: 0px;	margin-bottom: 0px;}.STYLE1 {color: #FF0000;	font-weight: bold;}.STYLE2 {color: #FF9900;	font-weight: bold;}a.tab:link {	text-decoration: none;	color:#000;        font-weight:bold;        font-size:12px;}a.tab:visited {	text-decoration: none;	color: #000;        font-weight:bold;        font-size:12px;}a.tab:hover {	text-decoration: none;	color: #3f3498;        font-weight:bold;        font-size:13px;}.search {background-image:url(images/search_m.gif); background-position:bottom; background-repeat:repeat-x;}.searchTitle {font-size:17px; font-weight:600; color:#333333;}.list {list-style:none; margin-left:15px; padding:0px;}.list {list-style:none; margin-left:15px; padding:0px;}.list1{list-style:none; margin-left:15px; padding:0px;margin-right:15px;}.list1 li{ margin-top:5px; color:#666666; padding:0px; border-bottom:1px dashed #CCCCCC; }.table_h3 {font-size:14px; font-weight:600; color:#fff;}.table_inner_left {border-bottom:1px dotted #CCCCCC;}#table_left {border-left:1px solid #999999; border-bottom:1px solid #999999; border-right:1px solid #999999;}--></style><script language="javascript">	function hotClick(hotname){		document.getElementById("searchbox").value=hotname;	}</script></head><body><table width="900" border="0" align="center" cellpadding="0" cellspacing="0">  <tr>    <td height="383" align="center" valign="top">        <table width="100%" border="0" cellspacing="0" cellpadding="0">      <tr>        <td align="center" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>              <td width="16%" height="85" rowspan="2" valign="middle">&nbsp;<a href="http://www.mysiky.com" ><img style="border:0px;" src="images/logo.gif" width="135" height="46" /></a><br /><span style="color:red;">思齐网旗下网站</span></td>            <td width="84%" align="left" valign="top">			<table class="top_table" width="100%" border="0" cellspacing="0" cellpadding="0">              <tr>                <td height="21" align="left">                    欢迎你:<span style="color:red;"><%=login.getUserid()%></span>&nbsp;&nbsp;&nbsp;<a href="exit">退出登录</a>                  </td>                </tr>            </table>            </td>          </tr>          <tr>            <td align="left" valign="bottom"><table width="90%" border="0" cellspacing="0" cellpadding="0">              <tr>                <td colspan="3"><table width="100%" border="0" cellspacing="0" cellpadding="0">                    <tr>                        <td width="115" height="31" align="center" background="images/navi_l_1.jpg"><a href="index.jsp" class="tab">首页</a></td>                      <td width="113" align="center" background="images/navi_m_1.jpg"><a href="mycart.jsp" class="tab">我的购物车</a></td>                      <td width="117" align="center" background="images/navi_r_1.jpg"><a href="list.jsp" class="tab">精品推荐</a></td>                      <td width="25">&nbsp;</td>                      <td width="563" align="right" valign="bottom"><table width="229" border="0" cellspacing="0" cellpadding="0">                          <tr>                            <td width="19" height="15" background="images/p_gwc.gif">&nbsp;</td>                            <td width="70" align="center"><a href="mycart.jsp">购物车</a></td>                            <td width="70" align="center"><a href="help.jsp">帮助中心</a></td>                            <td width="70" align="center"><a href="reg.jsp">新用户注册</a></td>                          </tr>                      </table></td>                    </tr>                </table></td>              </tr>              <tr>                <td width="1%" bgcolor="#EAEAEA"><img src="images/navi2_left.gif" width="4" height="23" /></td>                <td width="98%" align="left" bgcolor="#EAEAEA">&nbsp;&nbsp;&nbsp;<jsp:getProperty name="type" property="str" /> <br /></td>                <td width="1%" align="right" bgcolor="#EAEAEA"><img src="images/navi2_right.gif" width="5" height="23" /></td>              </tr>            </table></td>          </tr>        </table>          <table width="100%" border="0" cellspacing="0" cellpadding="0">            <tr>              <td height="5"></td>            </tr>          </table>          <table width="98%" border="0" cellspacing="0" cellpadding="0">            <tr>              <td width="0%" height="33" rowspan="2"><img src="images/search_l.gif" width="6" height="71" /></td>              <td width="47%" align="center" background="images/search_m.gif"><span class="STYLE1">热门分类</span>:<jsp:getProperty name="type" property="hotstr" /></td>              <td width="2%" align="left" valign="top" bgcolor="#E2F0FD"><img src="images/search_m2.jpg" width="42" height="33" /></td>              <td width="51%" height="33" align="left" bgcolor="#E2F0FD" style="background-image:url(images/search_m3.gif); background-position:top; background-repeat:repeat-x;">&nbsp;&nbsp;&nbsp;&nbsp;<span class="STYLE2">热门搜索词</span>:<a href="javascript:hotClick('炸酱面');">炸酱面</a>   | <a href="javascript:hotClick('红油饺子');">红油饺子</a> | <a href="javascript:hotClick('胖哥抄手');">胖哥抄手</a> | <a href="javascript:hotClick('燃面');">燃面</a> </td>              <td width="0%" rowspan="2" align="right"><img src="images/search_r.gif" width="6" height="71" /></td>            </tr>            <tr>              <td height="28" colspan="3" align="center" class="search"><form id="form1" style="margin-bottom:0px;" name="form1" method="post" action="">                <label>                <span class="searchTitle">商品搜索</span>                <input name="searchbox" type="text" id="searchbox"  style="height:16px; width:350px; vertical-align:middle;"/>                </label>                <label>                <input type="radio" name="radiobutton" value="radiobutton" checked="checked" />                菜名                <input type="radio" name="radiobutton" value="radiobutton" />                店名                                <input type="radio" name="radiobutton" value="radiobutton" />                价格                <input type="submit" name="Submit" value="提交" />                </label>                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;              </form>              </td>              </tr>          </table></td>      </tr>    </table>        <table width="100%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td height="10"></td>          </tr>        </table>        <table width="98%" border="0" cellspacing="0" cellpadding="0">          <tr>            <td align="left" valign="top"><img src="images/p_mycar.gif" width="121" height="21" /></td>          </tr>          <tr>            <td height="32" align="center" valign="top">&nbsp;</td>          </tr>          <tr>            <td align="center" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">              <tr>                <td><table width="882" border="0" cellspacing="0" cellpadding="0">                  <tr>                    <td width="8" align="left" background="images/choice_t_center.gif" bgcolor="#ACDAFE"><img src="images/choice_t_left.gif" width="7" height="27" /></td>                    <td width="865" background="images/choice_t_center.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">                        <tr>                          <td width="54%" align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;商品名</td>                          <td width="16%" align="center">价格&nbsp;&nbsp;</td>                          <td width="14%" align="center">数量&nbsp;&nbsp;</td>                          <td width="16%" align="center">删除&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>                        </tr>                    </table></td>                    <td width="9" align="right" background="images/choice_t_center.gif"><img src="images/choice_t_right.gif" width="7" height="27" /></td>                  </tr>                </table></td>              </tr>              <tr>                <td align="center"><table width="880" border="0" cellspacing="0" cellpadding="0" style="border:1px solid #ABD9FD;">                  <tr>                    <td width="8" align="left">&nbsp;</td>                    <td width="863">					<div class="table_inner_left">                    	<ul class="list1">                            <%                                java.util.Vector vect=(java.util.Vector)session.getAttribute("cartVector");                                if(vect==null){                                    java.util.Vector vectd=new java.util.Vector();                                    session.setAttribute("cartVector",vectd);                                    vect=(java.util.Vector)session.getAttribute("cartVector");                                }                                int i=0;                                int total=0;                                for(i=0;i<vect.size();i++){                                    cartInfo cat=(cartInfo)vect.get(i);                                    total=total+Integer.parseInt(cat.getFoodprice())*Integer.parseInt(cat.getFoodnum());                            %>							<li>								<table width="100%" border="0" cellspacing="0" cellpadding="0">								  <tr>									<td width="54%" align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=cat.getFoodname()%></td>									<td width="16%" align="center"><%=cat.getFoodprice()%> RMB </td>									<td width="14%" align="center"><%=cat.getFoodnum()%></td>                                                                        <td width="16%" align="center"><a href="cartdel?id=<%=cat.getFoodid()%>">删除</a></td>								  </tr>								</table>							</li>                            <%                                }                            %>						</ul>					</div>																				<table width="100%" border="0" cellspacing="0" cellpadding="0">                      <tr>                        <td align="left"><div>商品金额总计:¥<em><strong><span id="total_account"><%=total%></span></strong></em></div><a href="result">结帐</a></td>                      </tr>                    </table></td>                    <td width="9" align="right">&nbsp;</td>                  </tr>                </table></td>              </tr>            </table></td>          </tr>        </table></td>  </tr></table><table width="900" border="0" align="center" cellpadding="0" cellspacing="0">  <tr>    <td align="center"><hr width="98%" />        <p>关于本站 | 广告服务 | 店铺招商 | 招聘人才</p>      <p>Copyright &copy; 成信人 2007-2010 All Rights Reserved</p></td>  </tr></table></body></html>

⌨️ 快捷键说明

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