📄 admin_0005flogin_0002ejsp_jsp.java
字号:
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;
public class admin_0005flogin_0002ejsp_jsp extends HttpJspBase {
static {
}
public admin_0005flogin_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="/admin_login.jsp";from=(0,48);to=(1,0)]
out.write("\r\n");
// end
// HTML // begin [file="/admin_login.jsp";from=(1,31);to=(44,0)]
out.write("\r\n\r\n<html>\r\n<head>\r\n<title>BBS管理系统</title>\r\n<style type=\"text/css\">\r\n<!--\r\nbody {\r\n\tbackground-color: #FFCC99;\r\n}\r\n-->\r\n</style>\r\n</head>\r\n<body bgcolor=\"#ffffff\">\r\n<form name=\"form1\" id=\"form1\" method=\"post\" action=\"\">\r\n <table width=\"305\" height=\"209\" border=\"0\"align=\"center\" background=\"images\\dl.gif\">\r\n <tr align=\"center\">\r\n <td height=\"54\" colspan=\"2\"> </td>\r\n </tr>\r\n <tr>\r\n <td width=\"73\" > <strong>用户名:</strong></td>\r\n <td width=\"222\" >\r\n <INPUT style=\"BORDER-RIGHT: #B26C01 1px solid; BORDER-TOP: #B26C01 1px solid; FONT-SIZE: 10pt; BORDER-LEFT: #B26C01 1px solid; BORDER-BOTTOM: #B26C01 1px solid; BACKGROUND-COLOR: #F9E4C3\"\r\n maxLength=20 type=\"text\" name=\"name\" size=\"20\" autocomplete=\"off\"></td>\r\n </tr>\r\n <tr>\r\n <td> <strong>密 码:</strong></td>\r\n <td>\r\n <INPUT style=\"BORDER-RIGHT: #B26C01 1px solid; BORDER-TOP: #B26C01 1px solid; FONT-SIZE: 10pt; BORDER-LEFT: #B26C01 1px solid; BORDER-BOTTOM: #B26C01 1px solid; BACKGROUND-COLOR: #F9E4C3\"\r\n type=password maxLength=20 name=\"password\" size=\"20\"></td>\r\n </tr>\r\n\t<tr>\r\n\t<td colSpan=2>\r\n\t <HR width=275 color=#8A5A10 noShade SIZE=1></td>\r\n\t</tr>\r\n\t<tr align=\"center\">\r\n\t<td colspan=\"2\">\r\n\t<input type=\"submit\" value=\"登录\">\r\n\t<input type=\"reset\" value=\"重填\"></td>\r\n\t</tr>\r\n </table>\r\n</form>\r\n\r\n");
// end
// begin [file="/admin_login.jsp";from=(44,2);to=(63,0)]
Connection conn=null;
Statement stmt=null;
ResultSet rs=null;
String adminuser=request.getParameter("name");
String adminpassword=request.getParameter("password");
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn=DriverManager.getConnection("jdbc:odbc:bbs","","");
stmt=conn.createStatement();
rs=stmt.executeQuery("select * from admin where admin_user='"+adminuser+"' and admin_password='"+adminpassword+"'");
if(rs.next()) {
session.setAttribute("adminuser",adminuser);
response.sendRedirect("admin.jsp");
}
conn.close();
}catch(Exception e){
out.println(e.getMessage());
}
// end
// HTML // begin [file="/admin_login.jsp";from=(63,2);to=(66,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 + -