Methods Summary |
---|
public void | doValidate(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request, java.util.List errors)
if (validate != null) {
if (VALIDATE_EDIT_ACCOUNT.equals(validate) || VALIDATE_NEW_ACCOUNT.equals(validate)) {
if (VALIDATE_NEW_ACCOUNT.equals(validate)) {
account.setStatus("OK");
addErrorIfStringEmpty(errors, "User ID is required.", account.getUsername());
if (account.getPassword() == null || account.getPassword().length() < 1 || !account.getPassword().equals(repeatedPassword)) {
errors.add("Passwords did not match or were not provided. Matching passwords are required.");
}
}
if (account.getPassword() != null && account.getPassword().length() > 0) {
if (!account.getPassword().equals(repeatedPassword)) {
errors.add("Passwords did not match.");
}
}
addErrorIfStringEmpty(errors, "First name is required.", this.account.getFirstName());
addErrorIfStringEmpty(errors, "Last name is required.", this.account.getLastName());
addErrorIfStringEmpty(errors, "Email address is required.", this.account.getEmail());
addErrorIfStringEmpty(errors, "Phone number is required.", this.account.getPhone());
addErrorIfStringEmpty(errors, "Address (1) is required.", this.account.getAddress1());
addErrorIfStringEmpty(errors, "City is required.", this.account.getCity());
addErrorIfStringEmpty(errors, "State is required.", this.account.getState());
addErrorIfStringEmpty(errors, "ZIP is required.", this.account.getZip());
addErrorIfStringEmpty(errors, "Country is required.", this.account.getCountry());
}
}
|
public org.springframework.samples.jpetstore.domain.Account | getAccount() return account;
|
public java.util.List | getCategories() return categories;
|
public java.lang.String | getForwardAction() return forwardAction;
|
public java.util.List | getLanguages() return languages;
|
public org.springframework.util.PagedListHolder | getMyList() return myList;
|
public java.lang.String | getPassword() return password;
|
public java.lang.String | getRepeatedPassword() return repeatedPassword;
|
public java.lang.String | getUsername() return username;
|
public java.lang.String | getValidate() return validate;
|
public void | reset(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request)
super.reset(mapping, request);
setUsername(null);
setPassword(null);
setRepeatedPassword(null);
|
public void | setAccount(org.springframework.samples.jpetstore.domain.Account account) this.account = account;
|
public void | setCategories(java.util.List categories) this.categories = categories;
|
public void | setForwardAction(java.lang.String forwardAction) this.forwardAction = forwardAction;
|
public void | setLanguages(java.util.List languages) this.languages = languages;
|
public void | setMyList(org.springframework.util.PagedListHolder myList) this.myList = myList;
|
public void | setPassword(java.lang.String password) this.password = password;
|
public void | setRepeatedPassword(java.lang.String repeatedPassword) this.repeatedPassword = repeatedPassword;
|
public void | setUsername(java.lang.String username) this.username = username;
|
public void | setValidate(java.lang.String validate) this.validate = validate;
|