📄 ad_005flog_jsp.java
字号:
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class ad_005flog_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static java.util.Vector _jspx_dependants;
public java.util.List getDependants() {
return _jspx_dependants;
}
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;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html; charset=gb2312");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
check.login alogin = null;
synchronized (_jspx_page_context) {
alogin = (check.login) _jspx_page_context.getAttribute("alogin", PageContext.PAGE_SCOPE);
if (alogin == null){
alogin = new check.login();
_jspx_page_context.setAttribute("alogin", alogin, PageContext.PAGE_SCOPE);
}
}
out.write('\r');
out.write('\n');
try{
String mesg = "";
if( request.getParameter("username")!=null && !request.getParameter("username").equals("")){
String username =request.getParameter("username");
String passwd = request.getParameter("passwd");
username = new String(username.getBytes("ISO8859-1"));
passwd = new String(passwd.getBytes("ISO8859-1"));
alogin.setUsername(username);
alogin.setPasswd(passwd);
alogin.setIsadmin(true);
if (alogin.excute()){
session.setAttribute("admin","admin");
out.write("\r\n");
out.write("\t\t");
if (true) {
_jspx_page_context.forward("admin.jsp");
return;
}
out.write('\r');
out.write('\n');
}else {
mesg = "登录出错!" ;
}
}
out.write("\r\n");
out.write("\r\n");
out.write("<html>\r\n");
out.write("<head>\r\n");
out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n");
out.write("<title>>使用seesion对象进行身份验证</title>\r\n");
out.write("<script type=\"\" language=\"javascript\">\r\n");
out.write(" function checkform() {\r\n");
out.write("\tif (document.form1.username.value==\"\" || document.form1.passwd.value==\"\"){\r\n");
out.write("\t\talert(\"用户名或密码为空!\");\r\n");
out.write("\t\treturn false;\r\n");
out.write("\t}\r\n");
out.write("\treturn true;\r\n");
out.write("\r\n");
out.write(" }\r\n");
out.write("</script>\r\n");
out.write("</head>\r\n");
out.write("<body background=\"image/bg06.jpg\" text=\"#000000\">\r\n");
out.write("<div align=\"center\">\r\n");
out.write(" <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n");
out.write(" <tr>\r\n");
out.write(" <td align=\"center\">\r\n");
out.write(" <form name=\"form1\" method=\"post\" action=\"ad_log.jsp\">\r\n");
out.write("\r\n");
out.write(" <table width=\"360\" border=\"1\" cellspacing=\"2\" cellpadding=\"2\" bgcolor=\"#FFCC99\" style=\"font-size:9pt\">\r\n");
out.write(" <tr align=\"center\">\r\n");
out.write(" <td colspan=\"2\">\r\n");
out.write(" <h3><br>\r\n");
out.write(" <font color=\"#FF0000\">管理员登陆</font></h3>\r\n");
out.write(" <p> ");
if (!mesg.equals("")){
out.println(mesg);}
}catch(Exception e){e.printStackTrace();}
out.write("</p>\r\n");
out.write(" </td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td align=\"right\" width=\"150\"><font color=\"#009900\">管理员:</font></td>\r\n");
out.write(" <td>\r\n");
out.write(" <input type=\"text\" name=\"username\" size=\"12\" maxlength=\"20\">\r\n");
out.write(" </td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td align=\"right\" width=\"150\"><font color=\"#009900\">管理员密码:</font></td>\r\n");
out.write(" <td>\r\n");
out.write(" <input type=\"password\" name=\"passwd\" size=\"12\" maxlength=\"20\">\r\n");
out.write(" </td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr align=\"center\">\r\n");
out.write(" <td colspan=\"2\">\r\n");
out.write(" <input type=\"submit\" name=\"Submit\" value=\"登录\" onclick=\"javascript:return(checkform());\">\r\n");
out.write(" <input type=\"reset\" name=\"Submit2\" value=\"取消\">\r\n");
out.write(" </td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr align=\"center\">\r\n");
out.write(" <td colspan=\"2\"><A HREF=\"index.jsp\">返回首页</A></td>\r\n");
out.write(" </tr>\r\n");
out.write(" </table>\r\n");
out.write("\t </form>\r\n");
out.write(" <p> </p>\r\n");
out.write(" <p><br>\r\n");
out.write(" </p>\r\n");
out.write(" </td>\r\n");
out.write(" </tr>\r\n");
out.write(" </table>\r\n");
out.write("</div>\r\n");
out.write("</body>\r\n");
out.write("</html>\r\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -