package roseindia;

import com.opensymphony.xwork2.ActionSupport;

public class LoginAction extends ActionSupport {

	private String name;
	private int password;
	private String userEmail;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getPassword() {
		return password;
	}

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

	public String getUserEmail() {
		return userEmail;
	}

	public void setUserEmail(String userEmail) {
		this.userEmail = userEmail;
	}

	public String execute() throws Exception {
		System.out.println("Validating login");
		if ((!getName().equals("bharat"))) {
			addActionError("Invalid user name! Please try again!");
			return ERROR;
		} else {
			return SUCCESS;
		}
	}

}
