----- Original Message -----
From: "Wendy Smoak" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, October 17, 2003 6:42 PM
Subject: Deprecating ActionError/ActionErrors
>
> I don't know if this work is still ongoing, but I notice that
> ActionError and ActionErrors are deprecated, yet the validate method of
> DynaValidatorForm still returns an ActionErrors object.
>
> I looked at the validate method of DynaValidatorForm, and I'm confused.
> It doesn't seem to do what it says it does. AFAICT, this method
> *always* returns the empty ActionErrors object that's created with:
> ActionErrors errors = new ActionErrors();
Well, this is not true.
According to the code, the errors object gets passed to the initValidator( )
method which returns a Validator object, and the validator object than calls
the validate() method. Since Java pass by reference, the error object could
be changed in the initValidator() method as well as in the subsequent
validate() method.
Saul
>
> If errors ARE found, they're never put into that ActionErrors object,
> they're stored in the protected ValidatorResults object.
>
> /**
> * Validate the properties that have been set from this HTTP
> request,
> * and return an <code>ActionErrors</code> object that encapsulates
> any
> * validation errors that have been found. If no errors are found,
> return
> * <code>null</code> or an <code>ActionErrors</code> object with no
> * recorded error messages.
> *
> * @param mapping The mapping used to select this instance.
> * @param request The servlet request we are processing.
> * @return <code>ActionErrors</code> object that encapsulates any
> validation errors.
> */
> public ActionErrors validate(ActionMapping mapping,
> HttpServletRequest request) {
> this.setPageFromDynaProperty();
>
> 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;
> }
>
> Can someone who knows what's happening with ActionError/ActionErrors
> please post a summary?
>
> --
> Wendy Smoak
> Applications Systems Analyst, Sr.
> Arizona State University, PA, IRM
>
>
> ---------------------------------------------------------------------
> 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]