ValidationUtils.rejectIfEmptyOrWhitespace(errors, "securityquestion", "required.securityquestion", "Field name is required.");
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "securityanswer", "required.securityanswer","Field name is required.");
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "deptid", "required.deptid","Field name is required.");
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "position", "required.position","Field name is required.");
InternalAccount user = (InternalAccount)target;
Boolean result;
result = StringValidator.inputvalidation(user.getUsername(), "username");
if(!result){
errors.rejectValue("username","regex.username");
}
result = StringValidator.inputvalidation(user.getPassword(), "password");
if(!result){
errors.rejectValue("password","regex.password");
}
result = StringValidator.inputvalidation(user.getFirstname(), "general");
if(!result){
errors.rejectValue("firstname","regex.general");
}
result = StringValidator.inputvalidation(user.getLastname(), "general");
if(!result){
errors.rejectValue("lastname","regex.general");
}
result = StringValidator.inputvalidation(user.getDob(), "date");
if(!result){
errors.rejectValue("dob","regex.date");
}
result = StringValidator.inputvalidation(user.getSecurityanswer(), "general");
if(!result){
errors.rejectValue("securityanswer","regex.general");
}
result = StringValidator.inputvalidation(user.getAddress(), "address");
if(!result){
errors.rejectValue("address","regex.address");
}
result = StringValidator.inputvalidation(user.getPosition(), "general");
if(!result){
errors.rejectValue("position","regex.general");
}
result = StringValidator.inputvalidation(Integer.toString(user.getDeptid()), "dept");
if(!result){
errors.rejectValue("deptid","regex.dept");
}
result = StringValidator.inputvalidation(user.getSsn(), "number");
if(!result){
errors.rejectValue("ssn","regex.number");
}
result = StringValidator.inputvalidation(user.getTelephone(), "number");
if(!result){
errors.rejectValue("telephone","regex.number");
}
result = StringValidator.inputvalidation(user.getEmail(), "email");
if(!result){
errors.rejectValue("email","regex.email");
}
if(!(user.getPassword().equals(user.getVpassword()))){
errors.rejectValue("password", "notmatch.password");
}
if("NONE".equals(user.getSecurityquestion())){
errors.rejectValue("securityquestion", "required.securityquestion");
}
}