commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf Hauser (JIRA)" <j...@apache.org>
Subject [jira] Commented: (VALIDATOR-155) [validator] Distinguish between "no validation errors" found and "not validated"
Date Wed, 14 Mar 2007 13:50:09 GMT

    [ https://issues.apache.org/jira/browse/VALIDATOR-155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12480774
] 

Ralf Hauser commented on VALIDATOR-155:
---------------------------------------

see also https://issues.apache.org/struts/browse/STR-2347 and VALIDATOR-227

> [validator] Distinguish between "no validation errors" found and "not validated"
> --------------------------------------------------------------------------------
>
>                 Key: VALIDATOR-155
>                 URL: https://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.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message