On Monday, September 15, 2003 at 3:22:27 PM, Ritvik wrote:

R> Hi There,

R> I am using <html:errors\> tag at top of my page to display any
R> validation errors when a form is submitted, but for some reason, I
R> couldn't see any errors message even I have left some mandatory fields
R> blank. I am not getting any errors in server log as well.

R> I have added the validation logic in validate() method of ActionForm
R> subclass. I think Struts adds ActionErrors object in the request\session
R> scope with a know key, can anyone let me know the exaclt key name?

Are you sure you are actually calling the validate() method?  Either
validate="true"  in the action definition or call the validate()
method explicitly in the execute() method of the action as follows:

        errors = myForm.validate(mapping, request);
        // see if we found any validation errors
        if ( ! errors.isEmpty()) {
            saveErrors(request, errors);
            return (new ActionForward(mapping.getInput()));
        } // end of if ()


-- 
Louise Pryor
http://www.louisepryor.com



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

Reply via email to