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

📄 order_jsp.java

📁 网上服装店 能让用户在该网站上对物品进行上传购买等操作。该设计为原版
💻 JAVA
字号:
package org.apache.jsp.user;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;
import com.bwm.db.Condb;
import com.bwm.cart.buyList;
import java.util.Vector;

public final class order_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static java.util.Vector _jspx_dependants;

  public java.util.List getDependants() {
    return _jspx_dependants;
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html; charset=gb2312");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"625\" align=\"center\" >\r\n");
      out.write("      <tr>\r\n");
      out.write("        <td><img name=\"usercenter_01\" src=\"image/usercenter_01.gif\" width=\"625\" height=\"82\" border=\"0\" alt=\"\"></td>\r\n");
      out.write("      </tr>\r\n");
      out.write("      <tr>\r\n");
      out.write("        <td width=\"625\" background=\"image/usercenter_02.gif\">\r\n");
      out.write("\t\t<table width=\"600\" height=\"488\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" background=\"\"> \r\n");
      out.write(" <tr>\r\n");
      out.write("\t\t<td><img name=\"cplist_01_01\" src=\"image/gupic1.gif\" width=\"600\" height=\"50\" border=\"0\" alt=\"\">   </td>\r\n");
      out.write("\t\t\t</tr>\r\n");
      out.write("  <form action=\"user/clear.jsp\" method=\"post\" name=\"form1\">\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td height=\"429\" valign=\"top\"> \r\n");
      out.write("      <table width=\"600\"  border=\"1\" align=\"center\" cellpadding=\"0\" cellspacing=\"00\" class=\"tableBorder\"> \r\n");
      out.write("     \r\n");
      out.write("\t  <tr align=\"center\" valign=\"middle\"> \r\n");
      out.write("        <td height=\"40\" colspan=\"6\" nowrap background=\"\" class=\"bgcolor\"><font color=\"#FF0000\">\r\n");
      out.write("          ");
if(session.getAttribute("username")==null){out.println("您还没有登录");}else{out.println(session.getAttribute("username"));}
      out.write("</font>,您的购物情况如下所示:(注:如果想删除商品,请将数量置零后点击修改按钮。)\t\t</td> \r\n");
      out.write("      </tr> \r\n");
      out.write("      \r\n");
      out.write("     <tr align=\"center\" valign=\"middle\" class=\"bgcolor\">        \r\n");
      out.write("        <td width=\"100\" height=\"21\">序号</td>\r\n");
      out.write("        <td width=\"200\" height=\"21\">商品名称</td> \r\n");
      out.write("        <td width=\"100\" height=\"21\">单价</td> \r\n");
      out.write("        <td width=\"100\" height=\"21\">数量</td>\r\n");
      out.write("\t\t<td width=\"100\" height=\"21\">总金额</td>\r\n");
      out.write("\t</tr>\r\n");
      out.write("\t\t\r\n");
      out.write("\t");

	Vector shop=(Vector)session.getAttribute("shop");
	int num=0;
	int pric=0;
	if(shop==null||shop.size()==0){
	
      out.write(" \r\n");
      out.write("\t<script language=\"javascript\">\r\n");
      out.write("\t\talert(\"购物车中没有物品\");\r\n");
      out.write("\t\twindow.location.href=(\"index.jsp\");\r\n");
      out.write("\t</script> \r\n");
      out.write("\t");

	}else{
		for(int i=0;i<shop.size();i++){
			buyList mylist=(buyList)shop.elementAt(i);
			num=num+mylist.number*mylist.price;
	
      out.write(" \r\n");
      out.write("      <tr align=\"center\" valign=\"middle\" class=\"bgcolor\">        \r\n");
      out.write("        <td width=\"100\" height=\"21\">");
      out.print(i+1);
      out.write("</td>\r\n");
      out.write("        <td width=\"200\" height=\"21\">");
      out.print(mylist.warename);
      out.write("</td> \r\n");
      out.write("        <td width=\"100\" height=\"21\">¥");
      out.print(mylist.price);
      out.write("</td> \r\n");
      out.write("        <td width=\"100\" height=\"21\">\r\n");
      out.write("          <input name=\"num");
      out.print(i);
      out.write("\" size=\"7\" type=\"text\" class=\"txt_grey\" value=\"");
      out.print(mylist.number);
      out.write("\"></td> \r\n");
      out.write("        <td width=\"100\" height=\"21\">¥");
      out.print((mylist.price*mylist.number));
      out.write("</td> \r\n");
      out.write("        <script language=\"javascript\">\r\n");
      out.write("\t\t\t<!--\r\n");
      out.write("\t\t\tfunction check(){\r\n");
      out.write("\t\t\t\tif(isNaN(form1.num");
      out.print(i);
      out.write(".value)){\r\n");
      out.write("\t\t\t\t\talert(\"请不要输入非法字符\");\r\n");
      out.write("\t\t\t\t\treturn false;\r\n");
      out.write("\t\t\t\t\thistory.back();\r\n");
      out.write("\t\t\t\t}\r\n");
      out.write("\t\t\t\tif(form1.num");
      out.print(i);
      out.write(".value==\"\"){\r\n");
      out.write("\t\t\t\t\talert(\"请输入修改的数量\");\r\n");
      out.write("\t\t\t\t\treturn false;\r\n");
      out.write("\t\t\t\t\thistory.back();\r\n");
      out.write("\t\t\t\t}\t\r\n");
      out.write("\t\t\t}\r\n");
      out.write("\t\t\t-->\r\n");
      out.write("\t\t</script>\r\n");
      out.write("\t");

		}
	}
	
      out.write(" \r\n");
      out.write("      <tr align=\"center\" valign=\"middle\" class=\"bgcolor\">\r\n");
      out.write("\t\t<td height=\"21\" colspan=\"4\" align=\"right\">\r\n");
      out.write("\t\t\t总合计金额:</td>\r\n");
      out.write("        <td height=\"21\" align=\"center\">¥");
      out.print(num);
      out.write("</td>\r\n");
      out.write("      </table></td> \r\n");
      out.write("  </tr>\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td height=\"59\" align=\"center\" valign=\"top\" background=\"\"><a href=\"index.jsp\">\r\n");
      out.write("      </a><a href=\"index.jsp\">\r\n");
      out.write("      <input name=\"Submit\" type=\"submit\" class=\"btn_grey\" value=\"修改\" onClick=\"return check()\">\r\n");
      out.write("继续购物</a>|<a href=\"user/putin.jsp\">清空购物车</a>|<a href=\"user/index.jsp\">去收银台</a></td>\r\n");
      out.write("    </tr>\r\n");
      out.write("  </form>\r\n");
      out.write("</table>\r\n");
      out.write("\t\t\r\n");
      out.write("\t\t</td>\r\n");
      out.write("      </tr>\r\n");
      out.write("      <tr>\r\n");
      out.write("        <td><img name=\"usercenter_03\" src=\"image/usercenter_03.gif\" width=\"625\" height=\"4\" border=\"0\" alt=\"\"></td>\r\n");
      out.write("      </tr>\r\n");
      out.write("</table>\r\n");
      out.write("\r\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}

⌨️ 快捷键说明

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