You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by hu...@apache.org on 2004/06/08 16:57:43 UTC

cvs commit: jakarta-commons/validator/src/share/org/apache/commons/validator Form.java Validator.java

husted      2004/06/08 07:57:43

  Modified:    validator/src/share/org/apache/commons/validator Form.java
                        Validator.java
  Log:
  Apply #29151 "Allow validators to register errors for multiple fields" submitted by Don Brown.
  
  Revision  Changes    Path
  1.19      +4 -3      jakarta-commons/validator/src/share/org/apache/commons/validator/Form.java
  
  Index: Form.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/validator/src/share/org/apache/commons/validator/Form.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- Form.java	11 Apr 2004 06:47:22 -0000	1.18
  +++ Form.java	8 Jun 2004 14:57:42 -0000	1.19
  @@ -187,6 +187,7 @@
           throws ValidatorException {
   
           ValidatorResults results = new ValidatorResults();
  +        params.put(Validator.VALIDATOR_RESULTS_PARAM, results);
   
           Iterator fields = this.lFields.iterator();
           while (fields.hasNext()) {
  
  
  
  1.36      +22 -4     jakarta-commons/validator/src/share/org/apache/commons/validator/Validator.java
  
  Index: Validator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/validator/src/share/org/apache/commons/validator/Validator.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- Validator.java	8 Apr 2004 23:05:39 -0000	1.35
  +++ Validator.java	8 Jun 2004 14:57:42 -0000	1.36
  @@ -46,8 +46,25 @@
        */
       public static final String VALIDATOR_ACTION_PARAM =
               "org.apache.commons.validator.ValidatorAction";
  +            
  +    /**
  +     * Resources key the <code>ValidatorResults</code> is stored under.
  +     * This will be automatically passed into a validation method
  +     * with the current <code>ValidatorResults</code> if it is
  +     * specified in the method signature.
  +     */
  +    public static final String VALIDATOR_RESULTS_PARAM =
  +            "org.apache.commons.validator.ValidatorResults";        
   
       /**
  +     * Resources key the <code>Form</code> is stored under.
  +     * This will be automatically passed into a validation method
  +     * with the current <code>Form</code> if it is
  +     * specified in the method signature.
  +     */
  +    public static final String FORM_PARAM = "org.apache.commons.validator.Form";
  +            
  +    /**
        * Resources key the <code>Field</code> is stored under.
        * This will be automatically passed into a validation method
        * with the current <code>Field</code> if it is
  @@ -63,7 +80,7 @@
        */
       public static final String VALIDATOR_PARAM =
               "org.apache.commons.validator.Validator";
  -
  +            
       /**
        * Resources key the <code>Locale</code> is stored.
        * This will be used to retrieve the appropriate
  @@ -281,6 +298,7 @@
   
           Form form = this.resources.getForm(locale, this.formName);
           if (form != null) {
  +            this.setParameter(FORM_PARAM, this);
               return form.validate(
                   this.parameters,
                   this.resources.getValidatorActions(),
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org