--- Wendy Smoak <[EMAIL PROTECTED]> wrote:
>
> 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.
Only ActionError is deprecated right now. However, most of the references
to ActionErrors in Struts have been replaced with ActionMessages.
ActionErrors is still around because it's in the ActionForm.validate()
method signature. Use ActionMessage and ActionMessages wherever possible
for a Struts 1.2 app.
Eventually, we'll use Commons Resources' Message and MessageList
interfaces.
David
>
> 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();
>
> 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]
>
__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]