|
31 | 31 | * attempts, your controller code would look something like: |
32 | 32 | * |
33 | 33 | * <PRE> |
34 | | - * ValidationErrorList() errorList = new ValidationErrorList(); |
| 34 | + * ValidationErrorList errorList = new ValidationErrorList(); |
35 | 35 | * String name = ESAPI.validator().getValidInput("Name", form.getName(), "SomeESAPIRegExName1", 255, false, errorList); |
36 | 36 | * String address = ESAPI.validator().getValidInput("Address", form.getAddress(), "SomeESAPIRegExName2", 255, false, errorList); |
37 | | - * Integer weight = getValidInteger("Weight", form.getWeight(), 1, 1000000000, false, errorList); |
38 | | - * Integer sortOrder = getValidInteger("Sort Order", form.getSortOrder(), -100000, +100000, false, errorList); |
| 37 | + * Integer weight = ESAPI.validator().getValidInteger("Weight", form.getWeight(), 1, 1000000000, false, errorList); |
| 38 | + * Integer sortOrder = ESAPI.validator().getValidInteger("Sort Order", form.getSortOrder(), -100000, +100000, false, errorList); |
39 | 39 | * request.setAttribute( "ERROR_LIST", errorList ); |
40 | 40 | * </PRE> |
41 | 41 | * |
42 | | - * The at your view layer you would be able to retrieve all |
| 42 | + * Then at your view layer you would be able to retrieve all |
43 | 43 | * of your error messages via a helper function like: |
44 | 44 | * |
45 | 45 | * <PRE> |
46 | 46 | * public static ValidationErrorList getErrors() { |
47 | 47 | * HttpServletRequest request = ESAPI.httpUtilities().getCurrentRequest(); |
48 | 48 | * ValidationErrorList errors = new ValidationErrorList(); |
49 | | - * if (request.getAttribute(Constants.ERROR_LIST) != null) { |
| 49 | + * if (request.getAttribute("ERROR_LIST") != null) { |
50 | 50 | * errors = (ValidationErrorList)request.getAttribute("ERROR_LIST"); |
51 | 51 | * } |
52 | 52 | * return errors; |
|
0 commit comments