Hi there,
I am currently working on a frame-based application in which the left frame displays a server-side navigation tree and the right frame displays workpages.
Until now, clicking an element in the navigation tree resulting in displaying a new workpage in the right frame.
I have been asked to make the tree more "intelligent" such that it highlights the current branch and displays a branch's open/close states as well. In order to do this, though, I need to generate two actions for each click of the navigation tree, i.e. one action to refresh the tree display and another action to display the workpage.
There are several ways of doing this:
1. Modify my navigation links so that the frameset is invoked when a tree element is invoked. The frameset when takes on the responsibility of refreshing each of the individual pages.
2. Find a way of chaining my
struts actions together so that the invoking of one leads to the invoking of another.
3. Write a pre-processing Filter class that intercepts all client requests and issues a refresh-tree action before forwarding the request to the Struts Controller. The Struts Controller would then take on the responsibility of handling the workpage action.
4. Subclass the Struts Controller (in particular, its 'processForward', 'processInclude', 'processActionPerform', or 'processActionForward' methods) so that it refreshes the navigation tree in the background for each action sent to it (or a subclass of actions thereof.)
Has anyone had to deal with this issue? Does anyone have any suggestions on how to implement the forking of actions without having substantially to rewrite my struts-config file and/or action methods?
Cheers,
Darryl
PS: I think that #1 is the preferred method. However it would involve a substantial re-write of my code so I am not considering it. I am inclined to adopt #3 or #4.