struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Greg Maletic" <greg.male...@ZeroG.com>
Subject RE: Errors from within Action.perform()
Date Fri, 27 Jul 2001 00:09:57 GMT
Thanks.  Somehow I missed the "saveErrors()" method in the Action class, but
that looks like it will do what I want.
  -----Original Message-----
  From: struts-user-return-14145-greg.maletic=zerog.com@jakarta.apache.org
[mailto:struts-user-return-14145-greg.maletic=zerog.com@jakarta.apache.org]O
n Behalf Of Rama Krishna
  Sent: Thursday, July 26, 2001 4:49 PM
  To: struts-user@jakarta.apache.org; greg.maletic@ZeroG.com
  Subject: Re: Errors from within Action.perform()


  this should work.

  this is also there in struts example  "SaveRegistrationAction"

   errors.add("somestring",
                             new ActionError("error.key"));
   }

   if (!errors.empty()) {
       saveErrors(request, errors);
       return (new ActionForward(mapping.getInput()));
   }

  hope this helps

    ----- Original Message -----
    From: Greg Maletic
    To: struts-user@jakarta.apache.org
    Sent: Thursday, July 26, 2001 4:27 PM
    Subject: Errors from within Action.perform()


    Struts encourages two different ways to do form validation:  inside the
ActionForm.validate() method (presumably for low-level field validation) and
in the Action.perform() method (presumably for higher-level business logic
validation).  ActionForm.validate() lets me return an ActionError object
that displays error messages on the JSP.  Is there a way for me to leverage
this same error architecture from within my Action.perform() method?

    In other words, how can I generate error messages in my Action that will
display on the JSP, in exactly the same way that errors from my
ActionForm.validate() method can?  Is it somehow possible to generate an
ActionErrors object from inside an Action.perform() method?

    Thanks.

    ======================================
    Greg Maletic
    Chief Technical Officer
    Zero G Software, Inc.
    514 Bryant Street
    San Francisco, CA 94107

    tel: +1.415.512.7771 x303
    fax: +1.415.723.7244
    mailto:greg@ZeroG.com
    http://www.ZeroG.com

    The leading provider of multi-platform software deployment solutions.
    ======================================


Mime
View raw message