• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

[Struts] Handling Concurrent Actions

 
Ranch Hand
Posts: 314
2
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 314
2
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Amateurs built google. Professionals built the titanic. We can't find the guy that built this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic