Hi!
[EMAIL PROTECTED] wrote:
Hi Yaroslav,
On my side, I'm using an other method than your. I use the
oneSubmitAction to prepare the form of the next page. So, it look like this:
OnePrepareAction->oneView.jsp->OneSubmitAction/TwoPrepareAction->twoView.jsp
. The subtility in the OneSubmitAction/TwoPrepareAction is that I create a
twoView Form and I populate it. After, I put the form in the session scope.
In the case of my application, I has try to put it in the request but all go
wrong. So, with my method you skip the PrepareAction, you bind it with the
submitAction.
>
> Charles
>
Yes, I've tryed to use such a method before (to combine OneSubmitAction/
TwoPrepareAction into one), but have desided, that this not a very
correct way, because of code doubling. When you have to "call" (redirect
to) TwoXXX part from anywhere else, you have to double your
TwoPrepareAction code, so I've decided this to be wrong...
And the way I use now (prepare->view->submit) looks to me
self-sufficient (I meen by this, that it can be "called" without
modifying a "calling context". e.g. adding preprare code to a "calling"
action), though it does have (described) failers...
What can you say about this?
With best regards
Yaroslav Novytskyy
-----Original Message-----
From: Yaroslav Novytskyy [mailto:[EMAIL PROTECTED]
Sent: Monday, August 01, 2005 8:52 AM
To: Struts Users Mailing List
Subject: (re)populating forms between two actions
Hi!
I use a pattern of PrepareAction-> view.jsp-> SubmitAction and also
combine those parts to chains like this OnePrepareAction-> oneView.jsp->
OneSubmitAction-> TwoPrepareAction-> twoView.jsp-> TwoSubmitAction. All
actions and views of this chain uses one FormBean which lives in the
session scope.
As you can see two actions are binded here in a row (OneSubmitAction->
TwoPrepareAction) and this place a problem appears: FormBean gets
populated form the request twice - once before the OneSubmitAction and
second time before the TwoPrepareAction. So lets imagine, that
OneSubmitAction submits data to business tear and receives some as an
responce. OneSubmitAction modifies FormBean to pass busness'
modifications to the next Action and ends with a success, which leeds to
a forward to the "/twoPreapreAction.do". But here FormBean gets
populated (from the same request) once more and all modifications by
OneSubmitAction are rewritten.
So people, using the same setup->view->submit style, what is a nice
solution here?
best regards
Yaroslav
---------------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]