You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Niall Pemberton (JIRA)" <ji...@apache.org> on 2006/07/19 15:22:21 UTC

[jira] Updated: (VALIDATOR-155) [validator] Distinguish between "no validation errors" found and "not validated"

     [ http://issues.apache.org/jira/browse/VALIDATOR-155?page=all ]

Niall Pemberton updated VALIDATOR-155:
--------------------------------------

    Component/s: Framework

> [validator] Distinguish between "no validation errors" found and "not validated"
> --------------------------------------------------------------------------------
>
>                 Key: VALIDATOR-155
>                 URL: http://issues.apache.org/jira/browse/VALIDATOR-155
>             Project: Commons Validator
>          Issue Type: Improvement
>          Components: Framework
>         Environment: Operating System: other
> Platform: Other
>            Reporter: Ralf Hauser
>            Priority: Minor
>
> My form validates no matter how much many field rules the values violate.
> By debugging, I noticed that the form was not found in ValidatorResources.getForm(
>             String language,
>             String country,
>             String variant,
>             String formKey).
> The formName as per Validator.formName appears to be "attribute, {1}" while the
> formKey String probably rather should be "myFormName".
> At least in the ValidatorResources.hFormSets, the form is properly listed under
> "myFormName" in position 1 (starting at 0).
> Probably, the translation of "attribute, {1}" to "myFormName" that can be
> understood by this.forms.get(formName) in FormSet.getForm(String formName)
> appears to be lost.
> Basic Suggestion: fix it.
> But even more, provide a way to distinguish in
> org.apache.struts.validator.ValidatorForm.validate(ActionMapping mapping,
>                                  HttpServletRequest request)
> whether any fields have been validated at all.
> One idea is to amend ValidatorResources.java with
> public int numbOfFieldsValidated = 0;
> and have org.apache.commons.validator.Form.validate(Map params, Map actions, int
> page) increment that value
>         while (fields.hasNext()) {
>             Field field = (Field) fields.next();
>             results.numbOfFieldsValidated++; //NEW !!!
>             params.put(Validator.FIELD_PARAM, field);
> P.S.: I am using the commons-validator1.1.3 jar and struts1.2 jar.
> As a side note, I subclass one form to another, but this may be well unrelated.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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