📄 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 + -