Ok, now that you've fixed the first problem, let's try some more debugging.

Make sure that your form name in your JSP matches the form name specified in
your validation XML - i.e. check spelling AND cAsE.

I say to override validate(...) and as long as you call super.validate(...)
in that method and return the ActionErrors instance that it returns you're
ok, otherwise, you'd be ignoring any errors the validator framework may
find. (you can add your own errors to this ActionErrors if you need to do
more complex validation than the validation framework allows).  By this I
mean (in your ValidatorForm):

-- SNIP --

public ActionErrors validate(ActionMapping mapping,
                             HttpServletRequest request) {

    // will not return null
    ActionErrors errors = super.validate(mapping, request);

    ...
    <insert your system out's or logging statements here>
    ...

    return errors;
}

-- SNIP --

Let us know at least if you're getting your debug statements.

-Adam

-----Original Message-----
From: Jeremy Jardin [mailto:[EMAIL PROTECTED] 
Sent: Thursday, 20 July 2006 13:28
To: Struts Users Mailing List
Subject: Re: pb using validator it does not work !

>
> A couple of things:
>
> 1.  Not sure what version of Struts you're using, but at least according
> to
> http://struts.apache.org/1.2.9/userGuide/building_view.html#validator,
> the "property" attribute for the validator should have the value of
> "pathnames" and not the path of your action.


It's ok I had just tried with that value for test.. but it doesn't work :-/

2.  Make sure your bean extends ValidatorForm (or the Dyna one if using
> dyna forms...)


yes, i'st ok

Fix the above and see what happens.  If it's still not working, override
> the validate(...) method in your validator form bean and throw either
> some System.out's or Logger.log statements in there to make sure it's
> even being called.  Also, if you override, make sure you call
> super.validate to get any errors you've defined in your validation XML.


Should I really override that method ???

Reply via email to