?? 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\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\t\t");
if (true) {
_jspx_page_context.forward("admin.jsp");
return;
}
out.write('\r');
out.write('\n');
}else {
mesg = "登錄出錯!" ;
}
}
out.write("\r\n\r\n<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n<title>>使用seesion對象進行身份驗證</title>\r\n<script type=\"\" language=\"javascript\">\r\n function checkform() {\r\n\tif (document.form1.username.value==\"\" || document.form1.passwd.value==\"\"){\r\n\t\talert(\"用戶名或密碼為空!\");\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n\r\n }\r\n</script>\r\n</head>\r\n<body background=\"image/bg06.jpg\" text=\"#000000\">\r\n<div align=\"center\">\r\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n <tr>\r\n <td align=\"center\">\r\n <form name=\"form1\" method=\"post\" action=\"ad_log.jsp\">\r\n\r\n <table width=\"360\" border=\"1\" cellspacing=\"2\" cellpadding=\"2\" bgcolor=\"#FFCC99\" style=\"font-size:9pt\">\r\n <tr align=\"center\">\r\n <td colspan=\"2\">\r\n <h3><br>\r\n <font color=\"#FF0000\">管理員登陸</font></h3>\r\n <p> ");
if (!mesg.equals("")){
out.println(mesg);}
}catch(Exception e){e.printStackTrace();}
out.write("</p>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td align=\"right\" width=\"150\"><font color=\"#009900\">管理員:</font></td>\r\n <td>\r\n <input type=\"text\" name=\"username\" size=\"12\" maxlength=\"20\">\r\n </td>\r\n </tr>\r\n <tr>\r\n <td align=\"right\" width=\"150\"><font color=\"#009900\">管理員密碼:</font></td>\r\n <td>\r\n <input type=\"password\" name=\"passwd\" size=\"12\" maxlength=\"20\">\r\n </td>\r\n </tr>\r\n <tr align=\"center\">\r\n <td colspan=\"2\">\r\n <input type=\"submit\" name=\"Submit\" value=\"登錄\" onclick=\"javascript:return(checkform());\">\r\n <input type=\"reset\" name=\"Submit2\" value=\"取消\">\r\n </td>\r\n </tr>\r\n <tr align=\"center\">\r\n <td colspan=\"2\"><A HREF=\"index.jsp\">返回首頁</A></td>\r\n </tr>\r\n </table>\r\n\t </form>\r\n <p> </p>\r\n <p><br>\r\n </p>\r\n </td>\r\n </tr>\r\n");
out.write(" </table>\r\n</div>\r\n</body>\r\n</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);
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -