?? login.java
字號(hào):
package cn.com.ahead.A6.TS;
import cn.com.ahead.A6.TransactionProcess;
import javax.naming.*;
import javax.rmi.PortableRemoteObject;
public class login extends TransactionProcess {
public boolean execute(java.util.SortedMap sm){
String pwd=null;
Object ref=null;
try {
// try{
Context ctx = new InitialContext();
System.out.println("start to find sessionbean");
ref = ctx.lookup("cn/com/ahead/A6/sessionbean/ejb");
System.out.println("找到了sessionbean");
// }catch(NamingException e1){
// System.out.println("unable to lookup the EJBHome. Please make sure that you have deployed the ejb with the JNDI name ");
// throw e1;
// }
cn.com.ahead.A6.sessionbean.loginHome sessionLoginHome = (cn.com.ahead.A6.sessionbean.loginHome) PortableRemoteObject.narrow(ref, cn.com.ahead.A6.sessionbean.loginHome.class);
cn.com.ahead.A6.sessionbean.login login=sessionLoginHome.create();
pwd = login.getPwd((String)sm.get("NAME"));
System.out.println("現(xiàn)在在Ts中的login方法中得到值:"+pwd);
} catch(Exception e) {
pwd = null;
e.printStackTrace();
}
String password=(String)sm.get("PWD");
if((pwd==null)||(!(password.equals(pwd)))){
setReturnFlag(false);
}else{
setReturnFlag(true);
}
return isReturnFlag();
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -