login.java

来自「华为java接口反编译结果!其中包含其所有接口实现过程」· Java 代码 · 共 65 行

JAVA
65
字号
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 + =
减小字号Ctrl + -
显示快捷键?