package web;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionError;
import javax.servlet.http.HttpServletRequest;
/**
* @author dickinsona
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class RegistrationForm extends ActionForm {
private String firstname;
private String lastname;
private String username;
private String password;
private String password2;
private String phone;
private boolean registered=false;
public void setFirstname(String firstname){
this.firstname =firstname;
}
public void setLastname(String lastname){
this.lastname =lastname;
}
public void setUsername(String username){
this.username =username;
}
public void setPassword(String password){
this.password =password;
}
public void setPassword2(String password2){
this.password2 =password2;
}
public void setPhone(String phone){
this.phone =phone;
}
public String getFirstname(){
return firstname;
}
public String getLastname(){
return firstname;
}
public String getUsername(){
return lastname;
}
public String getPassword(){
return password;
}
public String getPassword2(){
return password2;
}
public String getPhone(){
return phone;
}
public void reset(ActionMapping mapping, HttpServletRequest request){
firstname=null;
lastname=null;
username=null;
password=null;
password2=null;
phone=null;
registered=false;
}
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request){
ActionErrors errors=new ActionErrors();
if (firstname==null || firstname.trim().equals("")){
errors.add("firstName",new ActionError("userRegistration.firstName.problem"));
}
return errors;
}
}