You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "David M. Karr" <dm...@earthlink.net> on 2002/02/14 18:52:37 UTC

Re: Passing Action Errors from one perform() method to another perfor m() method - Expert help?

>>>>> "John" == John Mattos <Mattos> writes:

    John> Hi all.
    John> I'm trying to do the following.

    John> In an Action.perform() method, I'm adding an ActionErrors object to the
    John> request as follows

    John> // Snippet from an Action.perform() method
    John> ActionErrors errors = new ActionErrors ();
    John> errors.add("Processed", new ActionError("Processing Done"));
    John> saveErrors(request, errors);
    John> return new ActionForward("/suspends.do");
    John> // End of first perform() snippet

    John> Notice that I'm forwarding to a ".do", which means I'm in another perform()
    John> method

    John> in the SECOND perform() method, I want to do some preprocessing (get stuff
    John> from a database)
    John> then forward to a JSP, and INLCUDE the actionErrors object from the first
    John> perform() method.
    John> Here's how I'm doing that now....

    John> // snipped from second perform() method, mapped to suspends.do
    John> ActionErrors errors = new ActionErrors();
    John> errors= (ActionErrors)request.getAttribute("Processed");		
    John> saveErrors (request, errors);
	    
    John> return new ActionForward("/invoicing/suspendsSummary.jsp");
    John> // End of second perform() snippet

    John> am I going about this in the wrong way? Is this even possible?

    John> basically, I want to pass a message back to the jsp that is really a status
    John> message (as in.. I'm done processing)

You may be showing an inappropriate example, but I would say that you're trying
to store information that is not an error.  I would just create a collection as
a session attribute and store this information.  You can display the records in
that collection in each JSP in the workflow.

-- 
===================================================================
David M. Karr          ; Java/J2EE/XML/Unix/C++
dmkarr@earthlink.net


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>