You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by gdelgado <gu...@netquotient.com> on 2001/07/05 23:09:06 UTC

ActionError

Is there any way that I can use the ActionErrors and ActionError to display
error messages that I get from the back-end of my application.

For Example:
if I get an error message I would like to do something like this.

ActionErrors ae = new ActionErrors();

if(myResponse.getStatus().equals("ERROR")){
    ae.add("reason", new ActionError(myResponse.getReason()));
}

...That way I can show the reason for the error like the other error
handlers do?

thanks in advance.
Gus


Re: ActionError

Posted by suhas <su...@techmas.hcltech.com>.
Yes . certainly . U can put that ActionErrors object in the request object
like - saveErrors(req,res) in ur Action  Class
Which in turn saves the ActionErrors in the request object with key as
"org.apache.struts.action.ERROR"
So in the Jsp page u can print those errors using <html:errors /> tag

But anyone want to comment on how the errors returned from data
yer(  EJBException ) handled ?


----- Original Message -----
From: gdelgado <gu...@netquotient.com>
To: <st...@jakarta.apache.org>
Sent: Thursday, July 05, 2001 10:09 PM
Subject: ActionError


> Is there any way that I can use the ActionErrors and ActionError to
display
> error messages that I get from the back-end of my application.
>
> For Example:
> if I get an error message I would like to do something like this.
>
> ActionErrors ae = new ActionErrors();
>
> if(myResponse.getStatus().equals("ERROR")){
>     ae.add("reason", new ActionError(myResponse.getReason()));
> }
>
> ...That way I can show the reason for the error like the other error
> handlers do?
>
> thanks in advance.
> Gus