package com.coderising.litestruts.action; /** * Created by huitailang on 17/3/4. * @author zhangkun * @date 2017年03月05日17:45:26 * 这是一个用来展示登录的业务类,其中的用户名和密码都是硬编码的 */ public class LoginAction { private String name; private String password; private String message; public String getName() { return name; } public String getPassword() { return password; } public String execute(){ if ("test".equals(name) && "1234".equals(password)){ this.message = "login successful"; return "success"; } this.message = "login failed, please check your user/pwd"; return "fail"; } public void setName(String name) { this.name = name; } public void setPassword(String password) { this.password = password; } public String getMessage() { return message; } }