FileDocCategorySizeDatePackage
MyLoginForm.javaAPI DocExample1196Mon Jul 05 16:56:08 BST 2004com.oreilly.strutsckbk.ch08

MyLoginForm

public class MyLoginForm extends org.apache.struts.action.ActionForm

Fields Summary
private String
username
private String
password
Constructors Summary
Methods Summary
public java.lang.StringgetPassword()

        return password;
    
public java.lang.StringgetUsername()

        return username;
    
public voidsetPassword(java.lang.String password)

        this.password = password;
    
public voidsetUsername(java.lang.String username)

        this.username = username;
    
public org.apache.struts.action.ActionErrorsvalidate(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request)

        ActionErrors errors = new ActionErrors();
        if (username == null || "".equals(username)) {
            errors.add("username", new ActionError("errors.required","The username"));
        }
        if (password == null || "".equals(password)) {
            errors.add("password", new ActionError("errors.required","The password"));
        }
        return errors;