/*
 * RegistroForm.java
 *
 * Created on 5 de noviembre de 2007, 11:30
 */

package javabeans;

import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

/**
 *
 * @author antonio.martin
 * @version
 */

public class RegistroForm extends org.apache.struts.action.ActionForm {
  private String nombre;
  private String apellidos;
  private String usuario;
  private String password;
  private String passwordrep;
  private String email;

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getApellidos() {
        return apellidos;
    }

    public void setApellidos(String apellidos) {
        this.apellidos = apellidos;
    }

    public String getUsuario() {
        return usuario;
    }

    public void setUsuario(String usuario) {
        this.usuario = usuario;
    }

    public String getPassword() {
        return password;
    }

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

    public void setPasswordrep(String passwordrep) {
        this.passwordrep = passwordrep;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }
  
    public ActionErrors validate(ActionMapping mapping, 
                                HttpServletRequest req){
        ActionErrors errors=new ActionErrors();
        if(!password.equals(passwordrep)){
            errors.add("password",new ActionMessage("error.password.nomatch"));
        }
        return errors;
    }
}
