You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jeff Smith <je...@centralscheduling.net> on 2003/04/11 19:45:24 UTC

Returning to starting point from action chain

We all do it - we have registration sequences, order processing sequences,
little wizard loops to build a complex schedule request. But when we get to
the end of the chain (or the user clicks on the cancel/abort button) we need
to jump back to where we started. If you're lucky enough to have only one
place where the user can initiate the sequence, then you can just set an
ActionForward called "returnToStart" and jump there.

But what if you have a utility sequence that could be invoked from many
places? People must have resolved this issue, but I haven't been able to
find a satisfactory description of how. So I put my thinking cap on.

My first thought was to just cache the "Referer" at step 1, and return there
when done. But not all browsers report Referer.

So I'm wondering about creating a "whereAmI" bean in the session scope and
having each JSP page set that bean to its own app-relative URL location.

Then when I jump to action step 1 (before I render the output JSP) I can
grab "whereAmI" and cache that. (I could even add it dynamically as an
action mapping called "returnToStart".)

It seems to me that this should work, and not rely on the browser to
properly report the Referer.

Two questions:
1) Is there a better mechanism than this already built into struts that I
just haven't found?
2) Should there be?

Jefficus


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org