package test.struts;

import org.apache.struts.action.*;
import javax.servlet.http.*;

public class LoginForm extends ActionForm {

	String userId, passWord;

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public void setPassWord(String passWord) {
		this.passWord = passWord;
	}

	public String getUserId() {
		return userId;
	}

	public String getPassWord() {
		return passWord;
	}

public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		ActionErrors ae = new ActionErrors();

		if (userId == null || userId.equals("")) {
			ae.add("userId", new ActionError("error.no.userId"));
		}

		if (passWord == null || passWord.equals("")) {
			ae.add("passWord", new ActionError("error.no.passWord"));
		}

		return ae;
	}
}