dwinterfeldt 01/09/25 11:00:11 Modified: contrib/validator/src/share/com/wintecinc/struts/validation StrutsValidator.java Log: Added some methods and functionality to support indexed validation. Revision Changes Path 1.2 +13 -13 jakarta-struts/contrib/validator/src/share/com/wintecinc/struts/validation/StrutsValidator.java Index: StrutsValidator.java =================================================================== RCS file: /home/cvs/jakarta-struts/contrib/validator/src/share/com/wintecinc/struts/validation/StrutsValidator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- StrutsValidator.java 2001/07/09 03:23:33 1.1 +++ StrutsValidator.java 2001/09/25 18:00:11 1.2 @@ -93,7 +93,7 @@ value = ValidatorUtil.getValueAsString(bean, field.getProperty()); if (GenericValidator.isBlankOrNull(value)) { - errors.add(field.getProperty(), ValidatorUtil.getActionError(application, request, va, field)); + errors.add(field.getKey(), ValidatorUtil.getActionError(application, request, va, field)); return false; } else { @@ -125,7 +125,7 @@ try { if (!GenericValidator.isBlankOrNull(value) && !GenericValidator.matchRegexp(value, mask)) { - errors.add(field.getProperty(), ValidatorUtil.getActionError(application, request, va, field)); + errors.add(field.getKey(), ValidatorUtil.getActionError(application, request, va, field)); return false; } else { @@ -162,7 +162,7 @@ String value = ValidatorUtil.getValueAsString(bean, field.getProperty()); if (!GenericValidator.isBlankOrNull(value) && !GenericValidator.isByte(value)) { - errors.add(field.getProperty(), ValidatorUtil.getActionError(application, request, va, field)); + errors.add(field.getKey(), ValidatorUtil.getActionError(application, request, va, field)); return false; } else { return true; @@ -188,7 +188,7 @@ String value = ValidatorUtil.getValueAsString(bean, field.getProperty()); if (!GenericValidator.isBlankOrNull(value) && !GenericValidator.isShort(value)) { - errors.add(field.getProperty(), ValidatorUtil.getActionError(application, request, va, field)); + errors.add(field.getKey(), ValidatorUtil.getActionError(application, request, va, field)); return false; } else { return true; @@ -214,7 +214,7 @@ String value = ValidatorUtil.getValueAsString(bean, field.getProperty()); if (!GenericValidator.isBlankOrNull(value) && !GenericValidator.isInt(value)) { - errors.add(field.getProperty(), ValidatorUtil.getActionError(application, request, va, field)); + errors.add(field.getKey(), ValidatorUtil.getActionError(application, request, va, field)); return false; } else { return true; @@ -240,7 +240,7 @@ String value = ValidatorUtil.getValueAsString(bean, field.getProperty()); if (!GenericValidator.isBlankOrNull(value) && !GenericValidator.isLong(value)) { - errors.add(field.getProperty(), ValidatorUtil.getActionError(application, request, va, field)); + errors.add(field.getKey(), ValidatorUtil.getActionError(application, request, va, field)); return false; } else { return true; @@ -266,7 +266,7 @@ String value = ValidatorUtil.getValueAsString(bean, field.getProperty()); if (!GenericValidator.isBlankOrNull(value) && !GenericValidator.isFloat(value)) { - errors.add(field.getProperty(), ValidatorUtil.getActionError(application, request, va, field)); + errors.add(field.getKey(), ValidatorUtil.getActionError(application, request, va, field)); return false; } else { return true; @@ -292,7 +292,7 @@ String value = ValidatorUtil.getValueAsString(bean, field.getProperty()); if (!GenericValidator.isBlankOrNull(value) && !GenericValidator.isDouble(value)) { - errors.add(field.getProperty(), ValidatorUtil.getActionError(application, request, va, field)); + errors.add(field.getKey(), ValidatorUtil.getActionError(application, request, va, field)); return false; } else { return true; @@ -345,7 +345,7 @@ } if (!bValid) - errors.add(field.getProperty(), ValidatorUtil.getActionError(application, request, va, field)); + errors.add(field.getKey(), ValidatorUtil.getActionError(application, request, va, field)); return bValid; } @@ -382,12 +382,12 @@ int max = Integer.parseInt(sMax); if (!GenericValidator.isInRange(iValue, min, max)) { - errors.add(field.getProperty(), ValidatorUtil.getActionError(application, request, va, field)); + errors.add(field.getKey(), ValidatorUtil.getActionError(application, request, va, field)); return false; } } catch (Exception e) { - errors.add(field.getProperty(), ValidatorUtil.getActionError(application, request, va, field)); + errors.add(field.getKey(), ValidatorUtil.getActionError(application, request, va, field)); return false; } } @@ -418,7 +418,7 @@ String value = ValidatorUtil.getValueAsString(bean, field.getProperty()); if (!GenericValidator.isBlankOrNull(value) && !GenericValidator.isCreditCard(value)) { - errors.add(field.getProperty(), ValidatorUtil.getActionError(application, request, va, field)); + errors.add(field.getKey(), ValidatorUtil.getActionError(application, request, va, field)); return false; } else { @@ -451,7 +451,7 @@ String value = ValidatorUtil.getValueAsString(bean, field.getProperty()); if (!GenericValidator.isBlankOrNull(value) && !GenericValidator.isEmail(value)) { - errors.add(field.getProperty(), ValidatorUtil.getActionError(application, request, va, field)); + errors.add(field.getKey(), ValidatorUtil.getActionError(application, request, va, field)); return false; } else { return true;