?? login.java
字號:
package com.kelefa.sms.action;
import com.opensymphony.xwork.Action;
import com.opensymphony.xwork.ActionContext;
import com.opensymphony.xwork.ActionSupport;
public class Login
extends ActionSupport
{
private String account;
private String password;
private String errorMsg;
public Login()
{
}
public String execute()
throws Exception
{
if ( password == null || password.length() == 0 ||
account == null || account.length() == 0 )
{
errorMsg = ( "帳號和密碼不能為空" );
return Action.LOGIN;
}
if ( !"skylink".equals( password ) || !"admin".equals( account ) ) {
errorMsg = ( "密碼錯誤" );
return Action.LOGIN;
}
ActionContext.getContext().getSession().put( "login", "true" );
return Action.SUCCESS;
}
public void setAccount( String account )
{
this.account = account;
}
public void setPassword( String password )
{
this.password = password;
}
public String getAccount()
{
return account;
}
public String getPassword()
{
return password;
}
public String getErrorMsg()
{
return errorMsg;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -