Thanks for the responses.
>From Andrej:
> what about subclassing the Struts Action and add a new method (that will
be
> available to all your new Actions) like
>
> protected void removeFormBean(ActionMapping mapping,
> HttpServletRequest request) {
I have a superclass of Action that I use for the actions in my app, and it
has this method on it already. This is the method that in fact cleans up
the session-scoped form bean correctly when the user submits the final step
of the multi-page form. It does not help me in the short circuit case,
though, because the short circuit links either do not execute an action at
all (global forwardings) or execute an action that is unrelated to the
multipage form - in fact I do not think they would have a hook to the form
to clean it up.
>From Alexander:
> do you have a "entrypoint" into this multipage-form? If yes, put it
behind
> an action and reset old leftover stuff in that action...
The entry point is currently just a forwarding, but I could put it behind
an action. I think if I combine this suggestion with what I was originally
thinking, it's a pretty good fix:
Create a generic action "cleanUpFormBean" that does nothing but remove
whatever form bean is associated with the action in the struts-config, and
always returns a forwarding like "success". This action can then be reused
to do entry-point or exit-point clean-up of session form beans with only
struts-config work. So I could change either my exit points or my entry
point to be executions of this action, with success mapped to the
appropriate logical destination.
I think use of the clean up action at the entry point to the multi-page
process makes more sense. It will leave less of a mess in the struts
config.
Thanks again.
Jim
Jim Weaver
Software Developer - ThoughtWorks
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>