Hi,

It seems pretty common for applications to need some kind of "what screen /
logical function did the user get here from" mechanism.  I think it would
be interesting to try to build an xml driven navigation tool that would
work with struts forwardings / actions.

The navigation bean could be kept on the session, and tell you:
- what logical function the user is currently at
- what logical functions should be available from the current function
- what function the user was at, if any, before arriving at the current
location - you could even keep a history here...

For any given function, you can find out what the url is for that function
or what the global forwarding is for it, or what the action name is for it.

An XML file could be built to configure the navigation bean, i.e.
<function name="viewWidgets" globalForwarding="viewWidgets">
     <navigation name="addWidget" actionName="addWidget.do"/>
     <navigation name="deleteWidget" actionName="deleteWidget.do"/>
     <navigation name="viewCustomers" globalForwarding="viewCustomers"/>
</function>

You could use this for building navigation links in the JSPs dynamically
and handling "where did I come from" context sensitive requirements.

I'm sure there's a lot wrong with this idea ;-).

Jim W.
ThoughtWorks


At 10:20 AM 10/23/01, [EMAIL PROTECTED] wrote:
>In an Action, is there a way to determine if the request is coming from a
>forward from another Action or from an "external" request?  I've thought
>about storing in the session the last known request object and then
>comparing against it every time any of my actions perform() get called to
>see if the current request is the same as the last "known" request.  But
>this feels clunky.
>Are there any other ways to know where the request is coming from?
>
>         Eric
>--
>Eric Rizzo, Software Engineer
>OpenNetwork Technologies
>http://www.opennetwork.com
>-----------------------------
>I embrace my personality flaws, for without them
>I might have no personality at all.


Jim Weaver
Software Developer - ThoughtWorks

Reply via email to