On Mon, 9 Feb 2004, Brian Ivey wrote:

> Dear List,
>
> I have to give my application users a way to navigate to the previous page
> without using the browser back button.  Program constraints prevent me from
> using JavaScript to solve this.  Because many JSP pages use the same Actions
> I am unable to simply hard code the referring page to navigate back to.
>
> Any thoughts would be appreciated.  BTW, I am inclined to believe that I can
> extract the referring page from one of the attributes sent to the Action
> (mapping, request, ...) and then cache this value as either a  parameter or
> as an attribute.  Does anyone think this could work?

I recently completed a mechanism for doing this.  It supports back
(previous) and cancel actions for you.

Basically, I keep 2 stacks in the session, one for standard navigation
and one for exception flows which simply are pointers the standard nav
stack.

In my base action, I call super.execute (I use DispatchAction, use an
abstract doExecute or whatever if you are going stock) with a custom
wrapped ActionMapping that takes (and manages) the request on the
constructor so that all calls to findforward are added to the stack.

What is boils down to is for normal flow of my application, I don't have
to do anything.  In the case where the user 'jumps' off the normal flow of
things, the app needs to provide a cancel that takes them back on flow
where they left off.  (all the while remember the back or previous page).

The only problem with our implementation is that all lists (drop down
collections) are retrieved via a caching mechanism that is invoked from
our dto getters (not my design), which allows our simple design to work so
fuently.

>From there, all the developers have to do is:
 - remeber to call addCancelAction() from any action that takes the user
   off of the normal flow
 - use an <%page include...%> which renders the previous or cancel button


Anyway, I can't indulge in all the details, but I hope you can get a
couple of ideas from that.



>
> Thanks,
> Brian Ivey
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-- 
James Mitchell
Software Developer / Struts Evangelist
http://www.struts-atlanta.org


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

Reply via email to