login.java

来自「airline reservation system is a simple j」· Java 代码 · 共 64 行

JAVA
64
字号
/*
 * Login.java
 *
 * Created on August 2, 2007, 10:13 AM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package com.foreapps.common.user;

import com.foreapps.common.InputManager;
import com.foreapps.common.OutputManager;
import com.foreapps.common.PasswordService;
import com.foreapps.general.ExceptionManager;
import com.foreapps.navigation.NavigationCommand;
import java.util.Vector;



/**
 *
 * @author Sailen
 */
public class Login implements NavigationCommand{
    
    /**
     *All the command Class Should implement the NavigationCommand Interface
     *execute Method is the entry point  
     */
   
    public OutputManager execute(InputManager objInp)throws ExceptionManager {
        boolean isloginsuccess=false;
        OutputManager out=new OutputManager();
        LoginAccess logAcc=new LoginAccess();
        try{
            
        isloginsuccess=logAcc.validateUser(objInp.getString("userid"), objInp.getString("password"));
        PasswordService ps =new PasswordService();
            
        
        }catch(Exception sqe){
               throw new ExceptionManager(1,this.getClass().getName(),"execute","Login Fails");
        }
        if(isloginsuccess){
           try{
            logAcc.setUserSessionData(objInp, objInp.getString("userid"));
           }catch(Exception e){
           throw new ExceptionManager(1,this.getClass().getName(),"execute","Login Fails");
           }
            out.setStrNavUrl("SUCCESS");
        }
        else{
        Vector vc=new Vector();
       vc.add("<font color='red'><p>Login Failed :(. Please try again</p></font>");
        out.setVcRes(vc);
        out.setStrNavUrl("FAIL");
        }
      
        return  out;
    }
    
}

⌨️ 快捷键说明

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