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

📄 buybook2ejsp.java

📁 JSP+SQL应用开发网上书店系统,采用BMP模式开发
💻 JAVA
字号:
import hell.*;
import ejb.*;
import java.util.*;
import javax.ejb.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;


public class buybook2ejsp extends HttpJspBase {


    static {
    }
    public buybook2ejsp( ) {
    }

    private static boolean _jspx_inited = false;

    public final void _jspx_init() throws org.apache.jasper.runtime.JspException {
    }

    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;
        String  _value = null;
        try {

            if (_jspx_inited == false) {
                synchronized (this) {
                    if (_jspx_inited == false) {
                        _jspx_init();
                        _jspx_inited = true;
                    }
                }
            }
            _jspxFactory = JspFactory.getDefaultFactory();
            response.setContentType("text/html;charset=GBK");
            pageContext = _jspxFactory.getPageContext(this, request, response,
            			"", true, 8192, true);

            application = pageContext.getServletContext();
            config = pageContext.getServletConfig();
            session = pageContext.getSession();
            out = pageContext.getOut();

            // HTML // begin [file="/buybook.jsp";from=(0,0);to=(0,31)]
                out.write("<title>BookStore Online</title>");

            // end
            // HTML // begin [file="/buybook.jsp";from=(0,77);to=(1,0)]
                out.write("\r\n");

            // end
            // HTML // begin [file="/buybook.jsp";from=(1,57);to=(70,0)]
                out.write("\r\n<html>\r\n<head>\r\n<title>BookStore Online</title>\r\n<style type=\"text/css\">\r\n</style>\r\n</head>\r\n<body bgcolor=\"#ffffff\">\r\n<hr>\r\n<h1>\r\n<div align=\"center\"></div>\r\n<table width=\"936\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#CCCCCC\">\r\n<tr>\r\n<td width=\"131\" class=\"style5\"><div align=\"center\"><a href=\"index.jsp\" class=\"style5\"><strong>用户登陆</strong></a></div></td>\r\n<td width=\"178\" class=\"style5\"><div align=\"center\"><a href=\"booklist.jsp\" class=\"style5\"><strong>在线购物</strong></a></div></td>\r\n<td width=\"239\" class=\"style5\"><div align=\"center\"><a href=\"cart.jsp\" class=\"style5\"><strong>我的购物车</strong></a></div>\r\n<div align=\"center\"></div></td>\r\n<td width=\"378\" align=\"right\" class=\"style5\"><div align=\"center\"><a href=\"list.jsp\" class=\"style5\"><strong>我的订单</strong></a></div></td>\r\n</tr>\r\n</table>\r\n<div align=\"center\"></div>\r\n<table width=\"800\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#CCCCCC\">\r\n<tr>\r\n<td width=\"500\"><div align=\"center\">\r\n<a class=\"titile\">已加入购物车,请点击我的购物车查看!</a></div>\r\n</td>\r\n<table width=\"100%\" height=\"48\" border=\"1\" cellpadding=\"1\" cellspacing=\"1\" >\r\n</tr>\r\n</table>\r\n\r\n<form name=\"form1\" method=\"post\" action=\"checkout.jsp\">\r\n<table width=\"700\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\">\r\n\r\nString bookId=request.getParameter(\"bookId\");\r\nString buynum=request.getParameter(\"buynum\");\r\nSystem.out.println(\"bookId:\"+bookId);\r\nVector buylist=(Vector)session.getValue(\"cart\");\r\nint ismatch=0;\r\nBook book=new Book(bookId,Integer.parseInt(buynum));\r\nif(buylist==null){\r\n buylist=new Vector();\r\nbuylist.addElement(book);\r\n}\r\nelse\r\n{\r\n  for(int i=0;i<buylist.size();i++){\r\n   Book _book=(Book)buylist.elementAt(i);\r\n   if(_book.getBookId().equals(book.getBookId())){\r\n     _book.setBuynum(_book.getBuynum()+book.getBuynum());\r\n      buylist.setElementAt(_book,i);\r\n      ismatch=1;\r\n    }\r\n  }\r\n  if(ismatch==0)\r\n  buylist.addElement(book);\r\n}\r\nsession.putValue(\"cart\",buylist);\r\nresponse.sendRedirect(\"cart.jsp\");\r\n\r\n</table>\r\n</form>\r\n\r\n</table>\r\n</h1>\r\n<td height=\"22\" class=\"style11\"><div align=\"center\"><a href=\"booklist.jsp\">\r\nBack</a></div>\r\n</td>\r\n</body>\r\n</html>\r\n");

            // end

        } catch (Throwable t) {
            if (out != null && out.getBufferSize() != 0)
                out.clearBuffer();
            if (pageContext != null) pageContext.handlePageException(t);
        } finally {
            if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
        }
    }
}

⌨️ 快捷键说明

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