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

📄 login_005fprocess_jsp.java

📁 JSP移动商品管理平台源代码.........
💻 JAVA
字号:
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.Hashtable;
import java.util.ArrayList;
import java.util.Iterator;

public final class login_005fprocess_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;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html;charset=gb2312");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			"/error/error.jsp", true, 8192, true);
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      bean.roles.RolesBean Validate = null;
      synchronized (pageContext) {
        Validate = (bean.roles.RolesBean) pageContext.getAttribute("Validate", PageContext.PAGE_SCOPE);
        if (Validate == null){
          try {
            Validate = (bean.roles.RolesBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "bean.roles.RolesBean");
          } catch (ClassNotFoundException exc) {
            throw new InstantiationException(exc.getMessage());
          } catch (Exception exc) {
            throw new ServletException("Cannot create bean of class " + "bean.roles.RolesBean", exc);
          }
          pageContext.setAttribute("Validate", Validate, PageContext.PAGE_SCOPE);
        }
      }
      out.write("\r\n");
      bean.syslogs.SyslogBean syslogs = null;
      synchronized (pageContext) {
        syslogs = (bean.syslogs.SyslogBean) pageContext.getAttribute("syslogs", PageContext.PAGE_SCOPE);
        if (syslogs == null){
          try {
            syslogs = (bean.syslogs.SyslogBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "bean.syslogs.SyslogBean");
          } catch (ClassNotFoundException exc) {
            throw new InstantiationException(exc.getMessage());
          } catch (Exception exc) {
            throw new ServletException("Cannot create bean of class " + "bean.syslogs.SyslogBean", exc);
          }
          pageContext.setAttribute("syslogs", syslogs, PageContext.PAGE_SCOPE);
        }
      }
      out.write("\r\n\r\n");

   //get request parameter
   String loginuser=request.getParameter("loginuser");
   String loginpassword=request.getParameter("password");
   loginuser=loginuser.trim();
   loginpassword=loginpassword.trim();

 
   //write logs
   config.getServletContext().log("loginuser:    "+loginuser+"    Servername: "+request.getServerName()+"    RemoteAddr: "+request.getRemoteAddr());
   String sUserID   = null;
   String sOrganID  = null;   
   String sOrganName= null;
   String slogindate= null;
   String syslog    = null;

   ArrayList list = Validate.getValidate(loginuser,loginpassword);
   Iterator itr = list.iterator();
   if  (itr.hasNext()) {
		Hashtable ht = (Hashtable) itr.next();   
  
							 //put login information
							 sUserID		=	ht.get("UserID").toString();		
							 sOrganID		=	ht.get("OrganID").toString();							 					 
							 loginuser	=	ht.get("UserCode").toString();
            	 sOrganName	=	ht.get("OrganName").toString();
            	 slogindate	=	ht.get("logindate").toString();
            	 //System.out.println("loginuser="+loginuser);
		           if (loginuser!=null)
            	 {                 
					session.setAttribute("UserID",sUserID);            	 
                	session.setAttribute("loginuser",loginuser);                	
                	session.setAttribute("Password",loginpassword);
                	session.setAttribute("OrganName",sOrganName);
                	session.setAttribute("logindate",slogindate);
									session.setAttribute("OrganID",sOrganID);
                	session.setAttribute("IdleAssetsList","-1");
                	session.setAttribute("IdleAssetsCount","-1");                	
                	syslog	=	"工号:["+loginuser+"] 登录系统";
                	syslogs.setSyslogs(loginuser, syslog);
                	pageContext.forward("/index.jsp");             	  
   
                }
                else{
                	pageContext.forward("/errorlogin.jsp"); 
                }
   }
   else{
                pageContext.forward("/errorlogin.jsp"); 
   }
         

      out.write("\r\n\r\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        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 + -