Vic wrote:


I allways say validate = false in mapping, and then manualy call it. Would that help?

I do the same. Validating manually also gives you the nice advantage of being able to set up any lists or other objects you need in request scope if valdiation fails. Bryce, an example of it might look like:



//class EmployeeDispatchAction – not showing any try/catch stuff

    private void setUp( HttpServletRequest request ) {
        Collection jobCodes = Service.getJobCodes();
        request.setAttribute(“jobCodes”, jobCodes);
    }

public ActionForward setUpForm(ActionMapping mapping, ...) throws Exception {
setUp( request );
return (mapping.findForward(UIconstants.TO_FORM));
}


public ActionForward update(ActionMapping mapping, ...) throws Exception {
ActionErrors errors = form.validate( mapping, request );
if ( errors != null && !errors.isEmpty ) {
saveErrors(request, errors);
return (mapping.findForward(UIconstants.VALIDATION_FAILURE));
}
//Everything OK, continue on...
//BeanUtils to copy Form to a ValueObject .. call service update
return (mapping.findForward(UIconstants.SUCCESS));
}



-- Rick

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



Reply via email to