📄 login.java
字号:
/*
* 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -