用Windows Live Writer发来

文字

 

image

 

package com.myeclipseide.example.myblog.secure;

import com.opensymphony.xwork2.ActionSupport;

public class AuthenticateUser extends ActionSupport {

    private String userName;

    private String password;

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String execute() {
        // Empty username or password value is not permitted. 
        if (getUserName().equals("") || getPassword().equals("")) {
            addActionError("Invalid username or password. Please try again!");
            return ERROR;
        }
        return SUCCESS;
    }
}
posted @ 2014-12-03 18:01  _amIurs  阅读(147)  评论(0编辑  收藏  举报