I can contribute a tiny bit to this issue.  I had the same server-side
validation problem and tried to use the debugger on it.  I couldn't figure
out what version of the src to use with the struts 1.1b2 commons-validator
jar, so I just got the latest commons-validator src release and built it
myself.  Once I started using this new jar, validation works almost
correctly.  My simple example works, but the message key isn't resolved.
Instead I get "???en_US.cam.form1.error.key1???."  That's the right key
except for the prepended locale stuff.

I haven't looked at the source code carefully, but I think Bens' concern
isn't a problem.  The ActionErrors instance is passed to the initValidator()
method.  The validator then holds on to that ref and populates it as
necessary.  This is all just speculation, though.  I know the code works.

john


-----Original Message-----
From: Michelle Harris [mailto:[EMAIL PROTECTED]] 
Sent: Monday, December 16, 2002 6:51 AM
To: Struts Users Mailing List; Struts Users Mailing List;
[EMAIL PROTECTED]
Subject: RE: Struts validating with beta2 not working for server-side
validation


I too haven't been able to get server-side validation to work. Although I
have been using a different release. When I use validator-1.0 from
dwinterfeldt's site, using server side validation results in nothing being
validated as described in Bens Kwable message.
 
Thanks,
Michelle Harris

        -----Original Message----- 
        From: Kwabla, Bens [mailto:[EMAIL PROTECTED]] 
        Sent: Mon 12/16/2002 07:13 
        To: 'Struts Users Mailing List' 
        Cc: 
        Subject: Struts validating with beta2 not working for server-side
validation
        
        

        Hi All!
        
        When I switch from client-side to server-side validation, the
validation is
        not effected. Now I called super.validate(..) in the validate(..)
method of
        my formbean (derived from ValidatorForm) and logged out
errors.size() which
        turned out to be 0, apparently indicating that my errors Object is
empty. I
        further checked the ValidatorForm.validate(..) method of the latest
nightly
        build and saw this code...
        
            public ActionErrors validate(ActionMapping mapping,
                                         HttpServletRequest request) {
        
                ServletContext application =
getServlet().getServletContext();
                ActionErrors errors = new ActionErrors();
        
                Validator validator =
        Resources.initValidator(mapping.getAttribute(),
                                     this,
                                     application, request,
                                     errors, page);
        
                try {
                    validatorResults = validator.validate();
                } catch (ValidatorException e) {
                    log.error(e.getMessage(), e);
                }
               
        
                return errors;
            }
        What I don't understand is the errors Object is returned, but I
don't see
        when it is filled with the validation results. Is it likely there is
a bug
        in here?
        
        
        -----Ursprüngliche Nachricht-----
        Von: David Graham [mailto:[EMAIL PROTECTED]]
        Gesendet: Freitag, 13. Dezember 2002 18:43
        An: [EMAIL PROTECTED]
        Betreff: Re: Struts validating with beta2 not working
        
        
        You need to tell us exactly what "not working" means.  Did you
replace all
        the jars in WEB_INF/lib with the new ones for beta 2?
        
        David
        

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

Reply via email to