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

📄 cashier_0002ejsp_jsp.java

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


public class cashier_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="/cashier.jsp";from=(3,0);to=(3,77)]
    // end

    static {
    }
    public cashier_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="/cashier.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="/cashier.jsp";from=(1,32);to=(2,0)]
                out.write("\r\n");

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

            // end
            // begin [file="/cashier.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="/cashier.jsp";from=(3,0);to=(3,77)]
                }
            // end
            // HTML // begin [file="/cashier.jsp";from=(3,77);to=(5,0)]
                out.write("\r\n<html>\r\n");

            // end
            // begin [file="/cashier.jsp";from=(5,2);to=(33,0)]
                
                //String username1=(String)request.getParameter("username");
                //String password1=(String)request.getParameter("password");
                //String t_username=null;
                String sql="select * from users where username='"+session.getAttribute("t_username") +"'"; //
                try{
                	Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;
                	Connection con=DriverManager.getConnection("jdbc:odbc:Shopping");
                	Statement st=con.createStatement();
                	ResultSet rs=st.executeQuery(sql) ;
                	while(rs.next()){
                		String username=rs.getString("username") ;
                session.setAttribute("t_username",username);
                		String realname=rs.getString("realname");
                session.setAttribute("realname",realname);
                		String Email=rs.getString("Email");
                session.setAttribute("t_Email",Email);
                		String postcode=rs.getString("postcode");
                session.setAttribute("t_postcode",postcode);
                		String address=rs.getString("address");
                session.setAttribute("t_address",address);
                		String telephone=rs.getString("telephone");
                session.setAttribute("t_telephone",telephone);
                
                //	session.setAttribute("t_username",username1) ;
                	}
                }
                catch(Exception e){System.out.println(e.getMessage() ) ;}
            // end
            // HTML // begin [file="/cashier.jsp";from=(33,2);to=(34,14)]
                out.write("\r\n<form action=\"");

            // end
            // begin [file="/cashier.jsp";from=(34,17);to=(34,41)]
                out.print(request.getContextPath());
            // end
            // HTML // begin [file="/cashier.jsp";from=(34,43);to=(37,79)]
                out.write("/receipt.jsp\" method=\"post\">\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="/cashier.jsp";from=(37,82);to=(37,114)]
                out.print(session.getAttribute("realname"));
            // end
            // HTML // begin [file="/cashier.jsp";from=(37,116);to=(38,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="/cashier.jsp";from=(38,83);to=(38,114)]
                out.print(session.getAttribute("t_Email"));
            // end
            // HTML // begin [file="/cashier.jsp";from=(38,116);to=(39,79)]
                out.write("\" size=\"19\"></td></tr>\r\n<tr><td><strong>邮编:</strong></td><td><input type=\"text\" name=\"postcode\" value=\"");

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

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

            // end
            // begin [file="/cashier.jsp";from=(41,83);to=(41,118)]
                out.print(session.getAttribute("t_telephone"));
            // end
            // HTML // begin [file="/cashier.jsp";from=(41,120);to=(50,9)]
                out.write("\" size=\"19\"></td></tr>\r\n<tr><td colspan=\"2\"><font size=\"4\" color=\"#ab00ab\">请选择订货方式:</font></td></tr>\r\n<tr><td width=\"100\"><input type=\"radio\" name=\"deliver_goods\" value=\"0\">送货上门</td><td>在仙林大学城内可以送货上门,每份订单加收<font color=\"#00ab00\">10块钱</font>的送货费!</td></tr>\r\n<tr><td width=\"100\"><input type=\"radio\" name=\"deliver_goods\" value=\"1\">快递</td><td>在仙林大学城以外可以邮寄,每份订单加收购买图书原价的<font color=\"#00ab00\">25%</font>收费!</td></tr>\r\n<tr><td colspan=\"2\"><font size=\"4\" color=\"#ab00ab\">请选择付款方式:</font></td></tr>\r\n<tr><td width=\"100\"><input type=\"radio\" name=\"payment\" value=\"0\">现金支付</td><td>若选送货上门可以现金支付!</td></tr>\r\n<tr><td width=\"100\"><input type=\"radio\" name=\"payment\" value=\"1\">银行卡支付</td><td></td></tr>\r\n</table>\r\n<br>\r\n<p>您一共购买了");

            // end
            // begin [file="/cashier.jsp";from=(50,12);to=(50,36)]
                out.print(cart.getNumberOfItems() );
            // end
            // HTML // begin [file="/cashier.jsp";from=(50,38);to=(51,11)]
                out.write("本书</P>\r\n<p>您应支付的金额为");

            // end
            // begin [file="/cashier.jsp";from=(51,14);to=(51,30)]
                out.print(cart.getTotal() );
            // end
            // HTML // begin [file="/cashier.jsp";from=(51,32);to=(57,0)]
                out.write("元</p>\r\n<br>\r\n<input type=\"submit\" 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 + -