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

📄 login_0002ejsp_jsp.java

📁 利用JSP技术开发BBS系统 ,本软件使用JAVA语言实现
💻 JAVA
字号:
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;


public class login_0002ejsp_jsp extends HttpJspBase {


    static {
    }
    public login_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="/login.jsp";from=(0,68);to=(8,0)]
                out.write("\r\n<html>\r\n<head>\r\n<title>\r\n用户登录页面\r\n</title>\r\n</head>\r\n<body bgcolor=\"#ffffff\">\r\n");

            // end
            // begin [file="/login.jsp";from=(8,0);to=(8,30)]
                {
                    String _jspx_qStr = "";
                    JspRuntimeLibrary.include(request, response, "logo.jsp" + _jspx_qStr, out, false);
                    if ("true".equals(request.getAttribute("javax.servlet.forward.seen")))
                        return;
                }
            // end
            // HTML // begin [file="/login.jsp";from=(8,30);to=(27,0)]
                out.write("\r\n\r\n<table border=\"0\" width=\"90%\" align=\"center\" bgcolor=\"#ffffff\" bordercolor=\"#F0F0F0\">\r\n  <form action='' method=\"post\">\r\n    <tr>\r\n      <td width=\"32%\" align=\"right\">用户名:</td>\r\n      <td width=\"68%\"><input size=\"20\"type=\"text\" name=\"username\">\r\n        <a href=\"user_reg.jsp\">立即注册</a></td>\r\n    </tr>\r\n    <tr>\r\n      <td align=\"right\">密 码:</td>\r\n      <td><input size=\"20\"type=\"password\" name=\"password\">\r\n        忘记密码</td>\r\n    </tr>\r\n    <tr>\r\n\t<td></td>\r\n      <td><input name=\"submit\" type=\"submit\" value=\"登录\"></td>\r\n    </tr>\r\n  </form>\r\n");

            // end
            // begin [file="/login.jsp";from=(27,2);to=(46,0)]
                
                Connection conn;
                Statement stmt;
                ResultSet rs;
                try{
                  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                  conn=DriverManager.getConnection("jdbc:odbc:bbs","","");
                  stmt=conn.createStatement();
                  String username=request.getParameter("username");
                  String password=request.getParameter("password");
                  rs=stmt.executeQuery("select * from user where username='"+username+"'and password='"+password+"'");
                 while(rs.next()){
                  session.setAttribute("username",username);
                  response.sendRedirect("index.jsp");
                }
                
                }catch(Exception e){
                	System.out.println(e);
                }
            // end
            // HTML // begin [file="/login.jsp";from=(46,2);to=(50,0)]
                out.write("\r\n</table>\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 + -