On Wed, 28 Jul 2004 10:38:17 +0530, Raghuram Kanadam
<[EMAIL PROTECTED]> wrote:
>         Very true. We agree Craig, but why should the moduleConfig be frozen, there 
> could have been a provision made for adding an action mapping dynamically, that 
> could determine its config at runtime. A situation follows:
> 
>         Maybe what I'm talking is really bad design but please enlighten me, we had 
> (have!) a situation wherein, a user has a multistep procedure and can navigate to 
> any previous step through links, however the form in the current JSP needs to retain 
> its values and needs to be validated, therefore he is allowed to goto a previous 
> step only after his current input is validated which would happen only after his 
> values are saved in the form by Struts.
> 
>         However this needs to be done only if the form has changed as validating 
> every field wud be unnecessary otherwise.
> So we have a saveAndForward Action which is always the target of a link/form submit. 
> In addition to the form parameters it receives a dirty flag (which says if the user 
> updated the form), a param saying where to go and a param saying to which form I 
> ought to submit this. Depending on the value of the forward I either forward it to 
> an action mapping or to the JSP requested.
>         Now all that action class does is a forward to the JSP and has no business 
> logic. So we just needed a dispatch action which could take its "parameter" at 
> runtime, and be associated with an action form and input at runtime. How would you 
> solve this situation? We are still thinking about adding an unfrozen action mapping 
> to the existing modules by overloading the initModules.
> 
> :)

Overloading initModules to do this is guaranteed to cause you grief
the moment you have two users who *ever* use the same forward.  Even
if they use them at different times, modifying the one-and-only
instance is *global* in its impact ... that's why I said it was fine
to create your own instances in this scenario.

Another alternative to consider is something like Struts Workflow
(http://www.livinglogic.de/Struts/), which is specifically designed to
deal with multiple page dialogs.

Craig

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

Reply via email to