You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2003/03/18 10:41:16 UTC

DO NOT REPLY [Bug 18094] New: - validate method on ValidatorForm should use mapping.getName as key to validator

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18094>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18094

validate method on ValidatorForm should use mapping.getName as key to validator

           Summary: validate method on ValidatorForm should use
                    mapping.getName as key to validator
           Product: Struts
           Version: Nightly Build
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: Validator Framework
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: poul-bildsoe.moller@cgey.com


In the validate method of the ValidatorForm mapping.getAttribute() is used as a 
key when initialising the Validator based on the definition entered in the 
validation.xml file. This doesn't make sense, since what defines a form is the 
name key and not under which key it is stored on the request (or session). Most 
people wouldn't notice the problem as they use the same token as attribute and 
name. I needed to decouple the key under which my forms are stored from the 
individual form (I use request scope, and static jsp-includes, so I needed to 
be able to group several different forms under same request key (because of the 
static jsp-includes)). When I gave all my forms the same attribute in the   
<action-mappings> part of the struts-config.xml I found that all my validations 
had disappeared. This is not a major problem, since I have my own 
BaseForm 'below' the ValidatorForm and thus where able to make my own 
implementation: Validator validator = Resources.initValidator(mapping.getName
(),this,application, request,errors, page);

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