Whenever I have done this I have always just passed along what I received
in the first Action... same mapping, request, etc.  Since I'm using the
second Action, in essence, as a helper in the first, the mapping for the
first is really what I'm servicing.  This of course means that you'll have
to be a little careful doing this because if that second Action really
depends on something in the mapping, or if it tramples something in
session, expects a different ActionForm type, etc., you can run into
trouble.  These things, in my experience, don't usually come up because I
only do this when I have a couple of Actions that perform functions on the
same screen.  It's not a true helper after all :)

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

On Wed, October 5, 2005 10:24 am, [EMAIL PROTECTED] said:
> Thanks!
>
> As Frank sayes if I can use the action as a normal class then I am
> comfortable with writing a method to or using the execute method.  If I
> use the execute method what would I pass in as my action mapping??
>
> For the actionForm I can pass my form which I hold in the session.
>
>
>
> -----Original Message-----
> From: Martin Gainty [mailto:[EMAIL PROTECTED]
> Sent: 05 October 2005 15:17
> To: Shoukat,F,Faisal,JPGA8Y C
> Cc: user@struts.apache.org
> Subject: Re: chaining actions i think!!
>
> I am unsure if you want to chain actions as this would not conform to
>  Action1->ActionForward1 where the design is meant to handle one action
> at a
> time
>
> store it as session variable and access it later
> Action...
>   execute(...
>
>        HttpSession session = request.getSession();
>         session.setAttribute("username",  username);
> test for presence of session.getAttribute("username") and result if not
> null
> prepopulate your form with the value
>
> Anyone else ?
> Martin-
> ----- Original Message -----
> From: <[EMAIL PROTECTED]>
> To: <user@struts.apache.org>
> Sent: Wednesday, October 05, 2005 6:47 AM
> Subject: chaining actions i think!!
>
>
> Hi,
>
> Is there a way that I can call another action from within a action
> class.  Is it as simple as just calling the execute method of the other
> action or another method of the action class as is required.?
>
> My scenario is as follows: A user searches on a client and is returned a
> number of results.  He then chooses to edit one of the results and goes
> to the edit jsp.  After editing the user has the option of returning
> back to the search results.
>
> To show the record that has been edited I am making another trip to the
> DB as I don't have a cache.  To return back to the results the user
> clicks on his button and is forwarded to the edit Action class.  It is
> from this action class that I want to call the search Action class
> passing in the search form which is held in the session.  This will then
> go to the DB and return to the appropriate search jsp.
>
> Any one any views on this
>
> Thanks
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to