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

📄 execute_0002ejsp_jsp.java

📁 深入浅出的介绍j2ee的相关基本知识
💻 JAVA
字号:
import java.sql.*;
import loginpro.DSBean;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;


public class execute_0002ejsp_jsp extends HttpJspBase {

    // begin [file="/execute.jsp";from=(11,0);to=(11,71)]
    // end

    static {
    }
    public execute_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=GBK");
            pageContext = _jspxFactory.getPageContext(this, request, response,
            			"error.jsp", true, 8192, true);

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

            // HTML // begin [file="/execute.jsp";from=(0,69);to=(2,0)]
                out.write("\r\n\r\n");

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

            // end
            // HTML // begin [file="/execute.jsp";from=(3,35);to=(11,0)]
                out.write("\r\n\r\n<html>\r\n<head>\r\n<title>\r\nexecute\r\n</title>\r\n</head>\r\n");

            // end
            // begin [file="/execute.jsp";from=(11,0);to=(11,71)]
                loginpro.UserBean userBean = null;
                boolean _jspx_specialuserBean  = false;
                 synchronized (session) {
                    userBean= (loginpro.UserBean)
                    pageContext.getAttribute("userBean",PageContext.SESSION_SCOPE);
                    if ( userBean == null ) {
                        _jspx_specialuserBean = true;
                        try {
                            userBean = (loginpro.UserBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "loginpro.UserBean");
                        } catch (ClassNotFoundException exc) {
                             throw new InstantiationException(exc.getMessage());
                        } catch (Exception exc) {
                             throw new ServletException (" Cannot create bean of class "+"loginpro.UserBean", exc);
                        }
                        pageContext.setAttribute("userBean", userBean, PageContext.SESSION_SCOPE);
                    }
                 } 
                if(_jspx_specialuserBean == true) {
            // end
            // begin [file="/execute.jsp";from=(11,0);to=(11,71)]
                }
            // end
            // HTML // begin [file="/execute.jsp";from=(11,71);to=(12,0)]
                out.write("\r\n");

            // end
            // begin [file="/execute.jsp";from=(12,0);to=(12,48)]
                JspRuntimeLibrary.introspect(pageContext.findAttribute("userBean"), request);
            // end
            // HTML // begin [file="/execute.jsp";from=(12,48);to=(18,0)]
                out.write("\r\n<body bgcolor=\"#ffffff\">\r\n<h1>\r\n登录密码检验\r\n</h1>\r\n<p>\r\n");

            // end
            // begin [file="/execute.jsp";from=(18,2);to=(29,1)]
                
                 Connection conn = DSBean.getConnection();
                 String sqlStr = "select count(*) from T_USER where USER_ID=? and password=?";
                 PreparedStatement pStat = conn.prepareStatement(sqlStr);
                 pStat.setString(1,userBean.getUserID());
                 pStat.setString(2,userBean.getPassword());
                 ResultSet rs = pStat.executeQuery();
                 if(rs.next() && rs.getInt(1) == 1)
                 out.print("您是合法的用户,欢迎您的到来!");
                 else
                 out.print("密码不对,或者您还没有注册为系统的用户");
                 
            // end
            // HTML // begin [file="/execute.jsp";from=(29,3);to=(34,0)]
                out.write("\r\n</p>\r\n\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 + -