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

📄 bag.jsp

📁 jsp编程jsp工程项目与实践 jsp源代码
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<% request.setCharacterEncoding("gb2312"); %>
<html>
<head>
<title>购物车</title>
<meta http-equiv=Content-Type content="text/html; charset=gb2312">
<link rel=stylesheet href="G.CSS" type=text/css>
</head>
<body> 
    <table width=60% border=0 align=center cellpadding=0 cellspacing=0>
      <tr>
        <td height=27 colspan=2><div align=center><b><img src=IMAGE/car.gif width=28 height=17></b> 商品购物车 </div></td>
      </tr>
      <tr>
        <td height="13" colspan="2" bgcolor=#006699><div align=center><font color="#FFFFFF">商品清单</font></div></td>
      </tr>
      <tr>
        <td colspan="2" align=center valign="top">
          <% String emp=request.getParameter("string");
  if(emp==null)
   {
   String th;
   String str=request.getParameter("shop");
   String price=request.getParameter("price");
   if(session.getAttribute("thing")==null)
       {   
	       str="<tr><td align=center>"+str+"</td><td align=center>"+price+"</td></tr>";
           session.setAttribute("thing",str);
	    }
   else
        {
		 th=(String)session.getAttribute("thing");
         str="<tr><td align=center>"+str+"</td><td align=center>"+price+"</td></tr>"+"<br>"+th;
	     session.setAttribute("thing",str);
	     }
out.print(session.getAttribute("thing"));  
     }
  else
     {
	  session.setAttribute("thing",null);
	  out.print("<tr><td colspan=2 align=center>您的购物车已经清空了!</td></tr>");
	 }	 
 %>
        </td>
      </tr>
      <tr>
        <td width="90%"></td>
        <td width="10%">&nbsp;</td>
      </tr>
      <tr>
        <td><div align=right>
            <form name="1" action="bag.jsp?string=empty" method="post">
              <input name="提交" type="submit" class="input3" value=" 清空购物车" size="6" src="IMAGE/button.gif">
            </form>
        </div></td>
        <td width="10%"><div align=left>
            <form name="1" action="index1.jsp" method="post">
              <input name="提交2" type="submit" class="input3" value=" 继续购买" size="6" src="IMAGE/button.gif">
            </form>
        </div></td>
      </tr>
      <tr>
        <td colspan=7><div align=left><img src=IMAGE/0035.gif width=97 height=126></div></td>
      </tr>
    </table>
  </body>
</html>

⌨️ 快捷键说明

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