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

📄 receipt_0002ejsp_jsp.java

📁 网上书店,JSP,MYSQL,struct,spring,hibernate
💻 JAVA
字号:
import bookshoppingsys.*;
import java.util.Properties;
import java.util.*;
import java.sql.*;
import java.text.SimpleDateFormat;
import java.util.Date ;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;


public class receipt_0002ejsp_jsp extends HttpJspBase {

    // begin [file="/common.jsp";from=(3,0);to=(3,77)]
    // end
    // begin [file="/common.jsp";from=(4,3);to=(10,0)]
        
           public String convert(String s){
            try{
             	return new String(s.getBytes("ISO-8859-1"),"GB2312");
            }catch(Exception e){return null;}
           }
    // end
    // begin [file="/receipt.jsp";from=(3,0);to=(3,77)]
    // end

    static {
    }
    public receipt_0002ejsp_jsp( ) {
    }

    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=GB2312");
            pageContext = _jspxFactory.getPageContext(this, request, response,
            			"errorpage.jsp", true, 8192, true);

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

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

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

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

            // end
            // HTML // begin [file="/common.jsp";from=(2,41);to=(3,0)]
                out.write("\r\n");

            // end
            // begin [file="/common.jsp";from=(3,0);to=(3,77)]
                bookshoppingsys.BookDB bookDB = null;
                boolean _jspx_specialbookDB  = false;
                 synchronized (application) {
                    bookDB= (bookshoppingsys.BookDB)
                    pageContext.getAttribute("bookDB",PageContext.APPLICATION_SCOPE);
                    if ( bookDB == null ) {
                        _jspx_specialbookDB = true;
                        try {
                            bookDB = (bookshoppingsys.BookDB) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "bookshoppingsys.BookDB");
                        } catch (ClassNotFoundException exc) {
                             throw new InstantiationException(exc.getMessage());
                        } catch (Exception exc) {
                             throw new ServletException (" Cannot create bean of class "+"bookshoppingsys.BookDB", exc);
                        }
                        pageContext.setAttribute("bookDB", bookDB, PageContext.APPLICATION_SCOPE);
                    }
                 } 
                if(_jspx_specialbookDB == true) {
            // end
            // begin [file="/common.jsp";from=(3,0);to=(3,77)]
                }
            // end
            // HTML // begin [file="/common.jsp";from=(3,77);to=(4,0)]
                out.write("\r\n");

            // end
            // HTML // begin [file="/common.jsp";from=(10,2);to=(12,0)]
                out.write("\r\n\r\n");

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

            // end
            // HTML // begin [file="/receipt.jsp";from=(2,86);to=(3,0)]
                out.write("\r\n");

            // end
            // begin [file="/receipt.jsp";from=(3,0);to=(3,77)]
                bookshoppingsys.ShoppingCart cart = null;
                boolean _jspx_specialcart  = false;
                 synchronized (session) {
                    cart= (bookshoppingsys.ShoppingCart)
                    pageContext.getAttribute("cart",PageContext.SESSION_SCOPE);
                    if ( cart == null ) {
                        _jspx_specialcart = true;
                        try {
                            cart = (bookshoppingsys.ShoppingCart) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "bookshoppingsys.ShoppingCart");
                        } catch (ClassNotFoundException exc) {
                             throw new InstantiationException(exc.getMessage());
                        } catch (Exception exc) {
                             throw new ServletException (" Cannot create bean of class "+"bookshoppingsys.ShoppingCart", exc);
                        }
                        pageContext.setAttribute("cart", cart, PageContext.SESSION_SCOPE);
                    }
                 } 
                if(_jspx_specialcart == true) {
            // end
            // begin [file="/receipt.jsp";from=(3,0);to=(3,77)]
                }
            // end
            // HTML // begin [file="/receipt.jsp";from=(3,77);to=(7,0)]
                out.write("\r\n<html>\r\n<body>\r\n<form action=\"OrderSuccess.jsp\" method=\"post\">\r\n");

            // end
            // begin [file="/receipt.jsp";from=(7,2);to=(20,1)]
                String deliver_goods=null;
                  String payment=null;
                if(request.getParameter("deliver_goods").equals("0")){
                	deliver_goods="送货上门";  session.setAttribute("deliver_goods",deliver_goods) ;
                }
                else if(request.getParameter("deliver_goods").equals("1")){
                	deliver_goods="快递";session.setAttribute("deliver_goods",deliver_goods) ;
                }
                if(request.getParameter("payment").equals("0")){
                	payment="现金支付";  session.setAttribute("payment",payment) ;
                }
                else if(request.getParameter("payment").equals("1")){
                	payment="银行卡支付";  session.setAttribute("payment",payment) ;
                }
            // end
            // HTML // begin [file="/receipt.jsp";from=(20,3);to=(23,79)]
                out.write("\r\n<table>\r\n<tr><td colspan=\"2\"><font size=\"4\" color=\"#ab00ab\">您的信息为:</font></td></tr>\r\n<tr><td><strong>姓名:</strong></td><td><input type=\"text\" name=\"realname\" value=\"");

            // end
            // begin [file="/receipt.jsp";from=(23,82);to=(23,116)]
                out.print(session.getAttribute("t_username"));
            // end
            // HTML // begin [file="/receipt.jsp";from=(23,118);to=(24,80)]
                out.write("\" size=\"19\"></td></tr>\r\n<tr><td><strong>E_mail:</strong></td><td><input type=\"text\" name=\"Email\" value=\"");

            // end
            // begin [file="/receipt.jsp";from=(24,83);to=(24,114)]
                out.print(session.getAttribute("t_Email"));
            // end
            // HTML // begin [file="/receipt.jsp";from=(24,116);to=(25,79)]
                out.write("\" size=\"19\"></td></tr>\r\n<tr><td><strong>邮编:</strong></td><td><input type=\"text\" name=\"postcode\" value=\"");

            // end
            // begin [file="/receipt.jsp";from=(25,82);to=(25,116)]
                out.print(session.getAttribute("t_postcode"));
            // end
            // HTML // begin [file="/receipt.jsp";from=(25,118);to=(26,78)]
                out.write("\" size=\"19\"></td></tr>\r\n<tr><td><strong>地址:</strong></td><td><input type=\"text\" name=\"address\" value=\"");

            // end
            // begin [file="/receipt.jsp";from=(26,81);to=(26,114)]
                out.print(session.getAttribute("t_address"));
            // end
            // HTML // begin [file="/receipt.jsp";from=(26,116);to=(27,80)]
                out.write("\" size=\"19\"></td></tr>\r\n<tr><td><strong>电话:</strong></td><td><input type=\"text\" name=\"telephone\" value=\"");

            // end
            // begin [file="/receipt.jsp";from=(27,83);to=(27,118)]
                out.print(session.getAttribute("t_telephone"));
            // end
            // HTML // begin [file="/receipt.jsp";from=(27,120);to=(28,63)]
                out.write("\" size=\"19\"></td></tr>\r\n<tr><td colspan=\"2\"><font size=\"4\" color=\"#ab00ab\">订货方式:</font>");

            // end
            // begin [file="/receipt.jsp";from=(28,66);to=(28,79)]
                out.print(deliver_goods);
            // end
            // HTML // begin [file="/receipt.jsp";from=(28,81);to=(29,63)]
                out.write("</td></tr>\r\n<tr><td colspan=\"2\"><font size=\"4\" color=\"#ab00ab\">付款方式:</font>");

            // end
            // begin [file="/receipt.jsp";from=(29,66);to=(29,73)]
                out.print(payment);
            // end
            // HTML // begin [file="/receipt.jsp";from=(29,75);to=(31,0)]
                out.write("</td></tr>\r\n</table>\r\n");

            // end
            // begin [file="/receipt.jsp";from=(31,2);to=(33,0)]
                
                  int num = cart.getNumberOfItems();
            // end
            // HTML // begin [file="/receipt.jsp";from=(33,2);to=(40,0)]
                out.write("\r\n<table>\r\n<tr>\r\n<th width=\"60\" align=center>数量</th>\r\n<th width=\"100\"align=center>书名</th>\r\n<th width=\"60\"align=center>价格</th>\r\n</tr>\r\n");

            // end
            // begin [file="/receipt.jsp";from=(40,2);to=(45,0)]
                
                    Iterator i = cart.getItems().iterator();
                    while (i.hasNext()) {
                      ShoppingCartItem item = (ShoppingCartItem)i.next();
                      BookDetails book = (BookDetails)item.getItem();
            // end
            // HTML // begin [file="/receipt.jsp";from=(45,2);to=(47,19)]
                out.write("\r\n<tr>\r\n<td align=\"center\">");

            // end
            // begin [file="/receipt.jsp";from=(47,22);to=(47,40)]
                out.print(item.getQuantity());
            // end
            // HTML // begin [file="/receipt.jsp";from=(47,42);to=(48,12)]
                out.write("</td>\r\n<td><strong>");

            // end
            // begin [file="/receipt.jsp";from=(48,15);to=(48,34)]
                out.print(book.getBook_name());
            // end
            // HTML // begin [file="/receipt.jsp";from=(48,36);to=(49,19)]
                out.write("</strong></td>\r\n<td align=\"center\">");

            // end
            // begin [file="/receipt.jsp";from=(49,22);to=(49,39)]
                out.print(book.getT_value());
            // end
            // HTML // begin [file="/receipt.jsp";from=(49,41);to=(51,0)]
                out.write("</td>\r\n</tr>\r\n");

            // end
            // begin [file="/receipt.jsp";from=(51,2);to=(51,3)]
                }
            // end
            // HTML // begin [file="/receipt.jsp";from=(51,5);to=(52,9)]
                out.write("</table>\r\n<p>您一共购买了");

            // end
            // begin [file="/receipt.jsp";from=(52,12);to=(52,36)]
                out.print(cart.getNumberOfItems() );
            // end
            // HTML // begin [file="/receipt.jsp";from=(52,38);to=(53,0)]
                out.write("本书</P>\r\n");

            // end
            // begin [file="/receipt.jsp";from=(53,2);to=(54,54)]
                //String deliver_goods=request.getParameter("deliver_goods");
                if(request.getParameter("deliver_goods").equals("0")){
            // end
            // HTML // begin [file="/receipt.jsp";from=(54,56);to=(55,11)]
                out.write("\r\n<p>您应支付的金额为");

            // end
            // begin [file="/receipt.jsp";from=(55,14);to=(55,29)]
                out.print(cart.getTotal());
            // end
            // HTML // begin [file="/receipt.jsp";from=(55,31);to=(56,11)]
                out.write("元</p>\r\n<p>您实支付的金额为");

            // end
            // begin [file="/receipt.jsp";from=(56,14);to=(56,32)]
                out.print(cart.getTotal()+10);
            // end
            // HTML // begin [file="/receipt.jsp";from=(56,34);to=(57,0)]
                out.write("元&nbsp;&nbsp;&nbsp;&nbsp;<font size=\"5\" color=\"#ab0000\">包含送货费!</font></p>\r\n");

            // end
            // begin [file="/receipt.jsp";from=(57,2);to=(57,71)]
                }else if(convert(request.getParameter("deliver_goods")).equals("1")){
            // end
            // HTML // begin [file="/receipt.jsp";from=(57,73);to=(58,11)]
                out.write("\r\n<p>您应支付的金额为");

            // end
            // begin [file="/receipt.jsp";from=(58,14);to=(58,29)]
                out.print(cart.getTotal());
            // end
            // HTML // begin [file="/receipt.jsp";from=(58,31);to=(59,11)]
                out.write("元</p>\r\n<p>您实支付的金额为");

            // end
            // begin [file="/receipt.jsp";from=(59,14);to=(59,50)]
                out.print(cart.getTotal()+cart.getTotal()*0.25);
            // end
            // HTML // begin [file="/receipt.jsp";from=(59,52);to=(61,0)]
                out.write("元&nbsp;&nbsp;&nbsp;&nbsp;<font size=\"5\" color=\"#ab0000\">包含邮寄费!</font></p>\r\n<br><br>\r\n");

            // end
            // begin [file="/receipt.jsp";from=(61,2);to=(61,3)]
                }
            // end
            // HTML // begin [file="/receipt.jsp";from=(61,5);to=(68,0)]
                out.write("\r\n请确认后提交订单,若信息有误,请点击这里<a href=\"Person.jsp\">修改</a>!<br>\r\n<br>\r\n<input type=\"submit\" name=\"confirm\" value=\"提交订单\">\r\n</form>\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 + -