This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
how can I make two actions communicate with each other
amit gupta
Greenhorn
Joined: Dec 29, 2006
Posts: 23
posted
0
Hi ,
The problem is like :
1) jsp 1 calls jsp 2 for some calculation.
2) jsp 2 calls action2 and does all the processing and mapping.findforward("jsp1"), will redirect to jsp1.
3) now, action1 should continue its working with the values returned by action2.
suppose these values are totalAmount and totalDistance;
I am not able to get totalAmount and totalDistance in action1.
I have taken the same variable names in form1 and form2 as totalDistance and totalAmount and provided the getters and setters in both forms.
could anyone give idea why these variables are not giving any value in action1. they are assigned proper values in action 2.
Please suggest.
Thanks in advance
SCJP 1.5, SCWCD 5.0
rogel garcia
Ranch Hand
Joined: Dec 19, 2003
Posts: 41
posted
0
Is there something wrong with this?
1) jsp 1 calls jsp 2 for some calculation.
2) jsp 2 calls action2 and does all the processing and mapping.findforward("jsp1"), will redirect to jsp1.
3) now, action1 should continue its working with the values returned by action2.
Where action1 is called?
SCJP 1.4
amit gupta
Greenhorn
Joined: Dec 29, 2006
Posts: 23
posted
0
rogel garcia wrote:Is there something wrong with this?
1) jsp 1 calls jsp 2 for some calculation.
2) jsp 2 calls action2 and does all the processing and mapping.findforward("jsp1"), will redirect to jsp1.
3) now, action1 should continue its working with the values returned by action2.
Where action1 is called?
my apologies for not being clear .
jsp1 -> action1, on click of a button on jsp 1, jsp 2 is called and then action 2.
David Newton wrote:What do you mean action 1 should "continue" with values from action 2? There is no "continue": it's a new request.
David,
I meant
1) jsp1->action1->(executes search)->(some search values are displayed on jsp1)->
2) jsp1(using javascript on click of a button )->jsp2() ->Action 2(perform something and gives "result")->forwarded to jsp1 using mapping.findforward().
now the "result" is not accessible on form1/action1/jsp1
is there any way I can access the values available on action2 directly from action1.
in jsp1 if I use , it shows the value of "result" properly.