struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Denis Wang <dw...@brandmuscle.com>
Subject RE: struts: error/message handling: saveErrors
Date Thu, 03 Jul 2003 18:08:24 GMT
Thanks a lot.  it works for me.
Denis

-----Original Message-----
From: Varun Garg [mailto:varun_garg@yahoo.com]
Sent: Thursday, July 03, 2003 11:55 AM
To: 'Struts Users Mailing List'
Subject: RE: struts: error/message handling: saveErrors


Instead of doing a new ActionErrors I have a function in my base Action
(U can just put it in the action that your are working on Baction).

    public ActionErrors getErrors(HttpServletRequest request){
        if (request.getAttribute(ERROR_KEY) != null) {
            return (ActionErrors) request.getAttribute(ERROR_KEY);
        }
        return new ActionErrors();
    }

Use this inside the execute.
        ActionErrors errors = getErrors(request);

 
Varun

-----Original Message-----
From: Denis Wang [mailto:dwang@brandmuscle.com] 
Sent: Thursday, July 03, 2003 10:48 AM
To: Struts Users Mailing List
Subject: struts: error/message handling: saveErrors


Hello, all,

I have the following problem:
In ActionA{
	....
                ActionErrors errors = new ActionErrors();
                errors.add( ActionErrors.GLOBAL_ERROR, new ActionError(
"Afailed" ) );
                saveErrors( request, errors );
}

In ActionB{
	....
                ActionErrors errors = new ActionErrors();
                errors.add( ActionErrors.GLOBAL_ERROR, new ActionError(
"Bfailed" ) );
                saveErrors( request, errors );
}

When ActionA returns it will forward the processing to ActionB and then
the "Bfailed" error will override the "Afailed" error.

How can I show both "Afailed" and "Bfailed" error messages?  Thanks a
lot! Denis



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message