Hi,
This is probably a newbie question but here goes:

If we call validation manually, the method signature reads:
validate(ActionMapping, HttpServletRequest)

I know what the request part does, but how and where does mapping fit in
there? What does it do? And how does the validation framework use it?

Any ideas?

Harsh.

-----Original Message-----
From: Mulligan, Scott H [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 09, 2006 9:19 AM
To: Struts Users Mailing List
Subject: RE: Validator stops when an error is encountered


Thanks Niall...that is exactly the type of thing I'm looking for.

However, I tried it and it did not work. I suspect it is because I am
using older versions of Struts (1.1) or commons-validator (1.0.2). Do I
need to upgrade anything to get this functionality? I created my own
workaround by extending the JavascriptValidatorTag to generate the
following:

    function validateSignIn(form) {

        if (bCancel) 
      return true; 
        else 
      {
       var bResult = true; 
       bResult = validateMaxLength(form) && bResult; 
bResult = validateRequired(form) && bResult; 
bResult = validateMinLength(form) && bResult; 
 
       return bResult; 
      }

The less I have to customize the better, though.

Thanks again for your input.


Scott Mulligan
EDS - Consulting Services
(201) 263-5367 (Client Site)
(908) 781-2995 (EDS Site)
8-481-2995
mailto:[EMAIL PROTECTED]



-----Original Message-----
From: Niall Pemberton [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 08, 2006 7:10 AM
To: Struts Users Mailing List
Subject: Re: Validator stops when an error is encountered

On 5/4/06, Mulligan, Scott H <[EMAIL PROTECTED]> wrote:
> The validate javascript function that gets generated by the validator 
> stops processing once one of the validation routines finds an error. 
> Is there a way to override the "&&" with "&" so that I can get all 
> errors at once? If so, where would I do this?
>
>    function validateSignIn(form) {
>
>        if (bCancel)
>      return true;
>        else
>       return validateMaxLength(form) && validateRequired(form) && 
> validateMinLength(form);
>   }
>
> I searched the archives, but did not see any solutions to this. Any 
> help would be appreciated.

In the struts-config.xml you can set the "stopOnFirstError" property to
false....

  <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames"
                              value="/WEB-INF/validator-rules.xml,
                                        /WEB-INF/validation.xml"/>
    <set-property property="stopOnFirstError" value="false"/>
  </plug-in>


Niall

> Scott Mulligan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to