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

📄 cash_jsp.java

📁 ShoppingOnline 是一个网上购物系统的源代码 由eclipse+jsp+tomcat+strust
💻 JAVA
字号:
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import cn.com.shoppingonline.*;
import java.util.*;

public final class cash_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=UTF-8");
      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("\t\r\n");
      out.write("\r\n");

	List shopCartList = (List)session.getAttribute(Constants.SHOPCART_KEY);
	ShopCart shopCart = null;
	double total=0;

      out.write("\r\n");
      out.write("<head>\r\n");
      out.write("<link href=images/css.css rel=STYLESHEET type=text/css>\r\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n");
      out.write("<title>收银台̨</title></head> \r\n");
      out.write("<body topmargin=\"0\">\r\n");
      out.write("<font color=\"#000000\"></FONT> \r\n");
      out.write("<br>\r\n");
      out.write("<table width=\"400\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" height=\"50\">\r\n");
      out.write("  <tr> \r\n");
      out.write("    <td align=\"center\">\r\n");
      out.write("    <images border=\"0\" src=\"images/promo_list_top.gif\" width=\"100%\" height=\"4\"></td>\r\n");
      out.write("  </tr>\r\n");
      out.write("  <tr> \r\n");
      out.write("    <td height=\"18\" bgcolor=\"#DBC2B0\" align=\"center\">收银台</td>\r\n");
      out.write("  </tr>\r\n");
      out.write("  <tr> \r\n");
      out.write("    <td height=\"25\" valign=\"top\"> <form method=\"POST\" action=\"cashOk.jsp\">\r\n");
      out.write("        <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" >\r\n");
      out.write("          <tr> \r\n");
      out.write("            <td valign=\"top\"> \r\n");
      out.write("            <table border=\"0\" width=\"416\" cellspacing=\"0\" height=\"34\" cellpadding=\"0\">\r\n");
      out.write("                <tr> \r\n");
      out.write("                  <td width=\"378\" height=\"120\" valign=\"bottom\" bgcolor=\"#F5EFE7\"><p><br>\r\n");
      out.write("                    您订购的物品如下:</p>\r\n");
      out.write("                    <div align=\"center\">\r\n");
      out.write("                      <center>\r\n");
      out.write("                    <table width=\"90%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\">\r\n");
      out.write("                      <tr background=\"images/tile_bg.gif\"> \r\n");
      out.write("                        <td width=\"195\" height=\"25\"><div align=\"center\">商品名称</div></td>\r\n");
      out.write("                        <td width=\"60\" height=\"25\"><div align=\"center\">单价</div></td>\r\n");
      out.write("                        <td width=\"60\" height=\"25\"><div align=\"center\">数量</div></td>\r\n");
      out.write("                        <td width=\"80\" height=\"25\"><div align=\"center\">合计</div></td>\r\n");
      out.write("                      </tr>\r\n");
      out.write("                      \r\n");
      out.write("\r\n");
      out.write("\t   ");
if(shopCartList != null ){

       for(int i = 0;i < shopCartList.size();i++)
       {  
       		shopCart = (ShopCart)shopCartList.get(i);
			total=total + shopCart.getPrice()*shopCart.getCount();
      
      out.write("\r\n");
      out.write("\r\n");
      out.write("                      <tr> \r\n");
      out.write("                        <td width=\"195\" height=\"25\"><div align=\"center\"><font color=red>");
      out.print(shopCart.getProduct().getName());
      out.write("</font></div></td>\r\n");
      out.write("                        <td width=\"60\" height=\"25\"><div align=\"center\">");
      out.print(shopCart.getPrice());
      out.write("元</div></td>\r\n");
      out.write("                        <td width=\"60\" height=\"25\"><div align=\"center\">");
      out.print(shopCart.getCount());
      out.write("</div></td>\r\n");
      out.write("                        <td width=\"80\" height=\"25\"><div align=\"center\">");
      out.print(shopCart.getPrice()*shopCart.getCount());
      out.write("元\r\n");
      out.write("                          </div></td>\r\n");
      out.write("                      </tr>\r\n");
      out.write("       ");

         }
      }	
      out.write("\r\n");
      out.write("\r\n");
      out.write("                      <tr> \r\n");
      out.write("                        <td height=\"25\"><div align=\"center\"><b class=\"dz1\">总计:<font color=red>");
      out.print(total);
      out.write("元</b></div></td>\r\n");
      out.write("                        <td height=\"25\" colspan=\"3\"><div align=\"center\"><b class=\"dz1\"> \r\n");
      out.write("                            <input  align=absMiddle alt=\"ȷ�� 确认\" name=\"B1\"   src=\"images/ok.gif\" type=image  width=\"45\" height=\"20\">\r\n");
      out.write("                            </b></div></td>\r\n");
      out.write("                      </tr>\r\n");
      out.write("                    </table>\r\n");
      out.write("                      </center>\r\n");
      out.write("                  </div>\r\n");
      out.write("                    <br> <table width=\"100%\" height=\"25\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
      out.write("                      <tr> \r\n");
      out.write("                        <td valign=\"middle\"><div align=\"center\"><images src=\"images/seperator.gif\" width=\"359\" height=\"1\"></div></td>\r\n");
      out.write("                      </tr>\r\n");
      out.write("                    </table></td></tr>\r\n");
      out.write("              </table>              \r\n");
      out.write("            </td>\r\n");
      out.write("          </tr>\r\n");
      out.write("        </table>\r\n");
      out.write("      </form></td>\r\n");
      out.write("  </tr>\r\n");
      out.write("</table>\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 + -