Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[Struts] Handling Concurrent Actions

 
Darryl A. J. Staflund
Ranch Hand
Posts: 310
2
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Darryl A. J. Staflund
Ranch Hand
Posts: 310
2
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I withdraw my question. After thinking about it a bit, I've come to think that I have to return a frameset to the client browser that contains the hyperlinks needed to refresh the two frames. If I try to spawn two responses for a single request on the server, I don't see how the client would know to catch the two responses. Frame requests have to originate from the client.
Cheers and thanks,
Darryl
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic