How are you certain the validation.xml isn't being called? Log the
ActionErrors stuff in the try block after the call to
validator.validate()

Actually I think the easiest is to just validate what you need
manually and then I think you should just be able to do:

super.validate(mapping, request);

Which should call the base class validate (which will use your validation.xml)

On 1/20/06, Raghu Kanchustambham <[EMAIL PROTECTED]> wrote:
> Thanks Rick! You spotted it correct...It now executes the validate
> function of the form :-)
>
> Now I move onto second step. I cut paste the code that you sent in the
> action form's validate function. Now the problem is that
> validation.xml is not having any effect.
>
>
> Just to paste back the exact code I have in my actionform's validate function:
>
>        ServletContext application = getServlet().getServletContext();
>        ActionErrors errors = new ActionErrors();
>        String parameter = request.getParameter(mapping.getParameter() );
>        Validator validator = Resources.initValidator( parameter,
> this, application, request,  errors, page);
>
>        try {
>          validatorResults = validator.validate();
>        } catch (ValidatorException e) {
>            
> System.out.println("***************************Exception!!!!*********************************************");
>            //log.error(e.getMessage(), e);
>        }
>
> return errors;
>
> Note that I am not attempting to make any additional validations here.
> I just want to call validation.xml validations using this piece of
> code you have mailed earlier. However, it appears that validation.xml
> is being ignored.
>
> Do I need to do something else to ensure validation.xml is called and
> so is the code in validationform's validate function?
>
> Regards,
> Raghu
>
> ps: I have not changed my action mappings from what I have last posted.
>
>
>
> On 1/20/06, Rick Reumann <[EMAIL PROTECTED]> wrote:
> > On 1/20/06, Raghu Kanchustambham <[EMAIL PROTECTED]> wrote:
> > > Let me repaste what I think might be relevant for you to take a look at 
> > > it:
> > >
> > >  DynaActionForm code: [ Note: This is extending DynaValidatorForm ]
> > > -----------------------------------
> > >
> > > public class StudentEnquiryDynaActionForm extends DynaValidatorForm
> > > {
> > >     public ActionErrors validate(ActionMapping actionMapping, 
> > > ServletRequest
> > > servletRequest)
> > >     {
> > >             System.out.println("**********************************In the
> > > validation!**********************");
> > >             return errors;
> > >    }
> > >
> > > }
> >
> > I think you need to override:
> >
> > public ActionErrors validate(ActionMapping mapping,
> >                                 HttpServletRequest request) {
> >
> > (Note  HttpServletRequest request and not  ServletRequest )
> >
> > ---------------------------------------------------------------------
> > 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]
>
>


--
Rick

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

Reply via email to