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

📄 loginyanzh_0002ejsp_jsp.java

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


public class LoginYanzh_0002ejsp_jsp extends HttpJspBase {


    static {
    }
    public LoginYanzh_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,
            			"", true, 8192, true);

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

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

            // end
            // HTML // begin [file="/LoginYanzh.jsp";from=(1,30);to=(4,0)]
                out.write("\r\n<html>\r\n<body>\r\n");

            // end
            // begin [file="/LoginYanzh.jsp";from=(4,2);to=(17,0)]
                
                String username1=(String)request.getParameter("username");
                String password1=(String)request.getParameter("password");
                //String t_username=null;
                String sql="select username,password from users where username='"+username1+"' and password='"+password1+"'"; //
                try{
                	Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;
                	Connection con=DriverManager.getConnection("jdbc:odbc:Shopping");
                	Statement st=con.createStatement();
                	ResultSet rs=st.executeQuery(sql) ;
                	if(rs.next()){
                	session.setAttribute("t_username",username1) ;
                //	out.println("登录成功!") ;
            // end
            // HTML // begin [file="/LoginYanzh.jsp";from=(17,2);to=(18,0)]
                out.write("\r\n");

            // end
            // begin [file="/LoginYanzh.jsp";from=(18,0);to=(18,33)]
                if (true) {
                    out.clear();
                    String _jspx_qfStr = "";
                    pageContext.forward("welcome.jsp" +  _jspx_qfStr);
                    return;
                }
            // end
            // HTML // begin [file="/LoginYanzh.jsp";from=(18,33);to=(19,0)]
                out.write("\r\n");

            // end
            // begin [file="/LoginYanzh.jsp";from=(19,2);to=(21,0)]
                }
                else{
            // end
            // HTML // begin [file="/LoginYanzh.jsp";from=(21,2);to=(27,0)]
                out.write("\r\n<script language=\"javascript\">\r\nalert(\"登录失败,请重新登录!\") ;\r\n</script>\r\n<br><br><br><br>\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"LeftBar.jsp\">返回</a>\r\n");

            // end
            // begin [file="/LoginYanzh.jsp";from=(27,2);to=(31,0)]
                
                  }
                }
                catch(Exception e){System.out.println(e.getMessage() ) ;}
            // end
            // HTML // begin [file="/LoginYanzh.jsp";from=(31,2);to=(34,0)]
                out.write("\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 + -