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

📄 ad_005flog_jsp.java

📁 JBuild工程
💻 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>&nbsp;");
 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>&nbsp;</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);
    }
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -