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

📄 shoperlist_jsp.java

📁 Tomcat 是一个小型的轻量级应用服务器
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.*;
import com.bookshop.bean.BookClass;
import com.bookshop.bean.Books;
import com.bookshop.dao.Booksmn;
import com.bookshop.bean.IndentList;

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

  private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();

  private static java.util.List _jspx_dependants;

  private javax.el.ExpressionFactory _el_expressionfactory;
  private org.apache.AnnotationProcessor _jsp_annotationprocessor;

  public Object getDependants() {
    return _jspx_dependants;
  }

  public void _jspInit() {
    _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
    _jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
  }

  public void _jspDestroy() {
  }

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

    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 {
      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("\r\n");
      out.write("\r\n");
      com.bookshop.dao.Booksmn book_list = null;
      synchronized (_jspx_page_context) {
        book_list = (com.bookshop.dao.Booksmn) _jspx_page_context.getAttribute("book_list", PageContext.PAGE_SCOPE);
        if (book_list == null){
          book_list = new com.bookshop.dao.Booksmn();
          _jspx_page_context.setAttribute("book_list", book_list, PageContext.PAGE_SCOPE);
        }
      }
      out.write('\r');
      out.write('\n');
      com.bookshop.dao.BookclassList classlist = null;
      synchronized (_jspx_page_context) {
        classlist = (com.bookshop.dao.BookclassList) _jspx_page_context.getAttribute("classlist", PageContext.PAGE_SCOPE);
        if (classlist == null){
          classlist = new com.bookshop.dao.BookclassList();
          _jspx_page_context.setAttribute("classlist", classlist, PageContext.PAGE_SCOPE);
        }
      }
      out.write('\r');
      out.write('\n');
      com.bookshop.dao.Purchase shop = null;
      synchronized (_jspx_page_context) {
        shop = (com.bookshop.dao.Purchase) _jspx_page_context.getAttribute("shop", PageContext.PAGE_SCOPE);
        if (shop == null){
          shop = new com.bookshop.dao.Purchase();
          _jspx_page_context.setAttribute("shop", shop, PageContext.PAGE_SCOPE);
        }
      }
      out.write("\r\n");
      out.write("\r\n");

	String userid = (String) session.getAttribute("userid");
	if (userid == null)
		userid = "";
	String modi = request.getParameter("modi");
	String del = request.getParameter("del");
	String payoutCar = request.getParameter("payout");
	String clearCar = request.getParameter("clear");
	String mesg = "";

	if (modi != null && !modi.equals(""))
	{
		if (!shop.modiShoper(request))
		{
			if (shop.getIsEmpty())
		mesg = "你要的修改购买的图书数量不足你的购买数量!";
			else
		mesg = "修改购买数量出错!";
		} else
		{
			mesg = "修改成功";
		}

	} else if (del != null && !del.equals(""))
	{
		if (!shop.delShoper(request))
		{
			mesg = "删除清单中的图书时出错!";
		}
	} else if (payoutCar != null && !payoutCar.equals(""))
	{
		if (shop.payout(request))
		{
			mesg = "你的购物车中的物品已提交给本店,你的订单号为 " + shop.getIndentNo()
			+ "<br>请及时付款,以便我们发货!";
			session.removeAttribute("shopcar");
		} else
		{
			if (!shop.getIsLogin())
		mesg = "你还没有登录,请先<a href=login.jsp>登录</a>后再提交";
			else
		mesg = "对不起,提交出错,请稍后重试";
		}
	} else if (clearCar != null && !clearCar.equals(""))
	{
		session.removeAttribute("shopcar");
		mesg = "购物车中的物品清单已清空";
	}

      out.write("\r\n");
      out.write("\r\n");
      out.write("<html>\r\n");
      out.write("\t<head>\r\n");
      out.write("\t\t<title>51网络电子书店--我的购物车</title>\r\n");
      out.write("\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n");
      out.write("\t\t<style>a{TEXT-DECORATION:none}a:hover{TEXT-DECORATION:underline}</style>\r\n");
      out.write("\t\t<script language=\"JavaScript\">\r\n");
      out.write("\t\tsetInterval(\"a.innerHTML=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay());\",1000);\r\n");
      out.write("\t\t</script>\r\n");
      out.write("\t\t<style type=\"text/css\">\r\n");
      out.write("<!--\r\n");
      out.write(".style2 {color: #000000}\r\n");
      out.write(".style14 {color: #3366FF}\r\n");
      out.write(".style16 {font-size: 18px; color: #3366FF;}\r\n");
      out.write("-->\r\n");
      out.write("</style>\r\n");
      out.write("\t\t<script language=\"javascript\">\r\n");
      out.write("\r\n");
      out.write("function openScript(url,name, width, height){\r\n");
      out.write("\tvar Win = window.open(url,name,'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=yes' );\r\n");
      out.write("}\r\n");
      out.write("function checklogin() {\r\n");
      out.write("\tif (document.payout.userid.value==\"\")\r\n");
      out.write("\t{\r\n");
      out.write("\t\talert(\"你还没有登录,请登录后再提交购物清单地。\");\r\n");
      out.write("\t\treturn false;\r\n");
      out.write("\t}\r\n");
      out.write("\treturn true;\r\n");
      out.write("}\r\n");
      out.write("\r\n");
      out.write("function check()\r\n");
      out.write("{\r\n");
      out.write("\tif (document.change.amount.value<1){\r\n");
      out.write("\t\talert(\"你的购买数量有问题\");\r\n");
      out.write("\t\tdocument.change.amount.focus();\r\n");
      out.write("\t\treturn false;\r\n");
      out.write("\t}\r\n");
      out.write("\treturn true;\r\n");
      out.write("}\r\n");
      out.write("\r\n");
      out.write("</script>\r\n");
      out.write("\t<link rel=\"stylesheet\" href=\"books.css\" type=\"text/css\">\r\n");
      out.write("\t</head>\r\n");
      out.write("\r\n");
      out.write("\t<body text=\"#000000\">\r\n");
      out.write("\t\t<div align=\"center\">\r\n");
      out.write("\t\t\t<table width=\"750\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n");
      out.write("\t\t\t\t<tr>\t\t\t\t\t\r\n");
      out.write("\t\t\t\t\t<td align=\"center\"><img src=\"images/title.jpg\" width=\"750\" height=\"100\"></td>\r\n");
      out.write("\t\t\t\t</tr>\r\n");
      out.write("\t\t\t</table>\r\n");
      out.write("\r\n");
      out.write("\t\t\t<table width=\"750\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\" >\r\n");
      out.write("\t\t\t\t<tr>\r\n");
      out.write("\t\t\t\t  <td width=\"100\" height=\"30\" align=\"center\" background=\"images/qntj.jpg\"><a href=\"index.jsp\" class=\"style14\">首页</a></td>\r\n");
      out.write("\t\t\t\t  <td width=\"100\" align=\"center\" background=\"images/qntj.jpg\"><a href=\"booklist.jsp\" class=\"style14\">在线购物</a></td>\r\n");
      out.write("\t\t\t\t  <td width=\"100\" align=\"center\" background=\"images/qntj.jpg\"><a href=\"shoperlist.jsp\" class=\"style14\">我的购物车</a></td>\r\n");
      out.write("\t\t\t\t  <td width=\"100\" align=\"center\" background=\"images/qntj.jpg\"><a href=\"login.jsp\" class=\"style14\">用户登录</a></td>\r\n");
      out.write("\t\t\t\t  <td width=\"100\" align=\"center\" background=\"images/qntj.jpg\"><a href=\"manage/login.jsp\" class=\"style14\">网站管理</a></td>\r\n");
      out.write("\t\t\t\t  <td width=\"250\" align=\"center\" background=\"images/qntj.jpg\"><div id=\"a\"><span class=\"style7\"></span></div></td>\r\n");
      out.write("\t\t\t\t</tr>\r\n");
      out.write("\t\t  </table>\r\n");
      out.write("\t\t  \r\n");
      out.write("\t\t\t<table width=\"750\" height=\"414\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#33CCFF\">\r\n");
      out.write("\t\t\t\t<tr valign=\"top\">\r\n");
      out.write("\t\t\t\t\t<td width=\"150\" height=\"412\">\r\n");
      out.write("\t\t\t\t\t\t<table width=\"150\" class=\"style17\" height=\"74\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\"  align=\"center\">\r\n");
      out.write("\t\t\t\t\t\t\t<tr align=\"center\">\r\n");
      out.write("\t\t\t\t\t\t\t\t<td width=\"123\" height=\"44\" background=\"images/qntj.jpg\" align=\"center\">\r\n");
      out.write("\t\t\t\t\t\t\t\t\t<span class=\"style16\">本店图书分类</span>\t\t\t\t\t\t\t\t\t\t\r\n");
      out.write("\t\t\t\t\t\t\t  </td>\r\n");
      out.write("\t\t\t\t\t\t\t</tr>\r\n");
      out.write("\t\t\t\t\t\t\t");

								if (classlist.excute())
								{
									for (int i = 0; i < classlist.getClasslist().size(); i++)

⌨️ 快捷键说明

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