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

State in Struts

 
Ron Perich
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This may be somewhat difficult to explain, but I'll give it a shot. Your thought are appreciated.

I have a Struts w/ Tiles application I am developing. I have a sidebar containing menus A, B, and C. I would like for each of these menus to maintain their state when the user changes them (e.g., minimize/maximize) so that the next time the user logs into the system, it will show up exactly the same way. I have all of the code written to maintain the state in the persistence layer and everything works fine.

However, I have no idea on how I can get the user back to the exact page they were viewing when they change the state of a menu. Right now, I have it going back to the application home page, but that's really not user-friendly.

I was hoping you wise folks might have come across a similar situation and could help me address this issue:

How can I get the user back to the exact same page they were looking at when the state of Menu A, B, or C changes?

Thanks in advance for your help!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64633
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the Frameworks forum.
 
Ron Perich
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone have any thoughts on this?
 
Ali Gohar
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I think you can store the URL of the page in Session and then on change of each menu you can check to see if the session has any url then move to that url otherwise to the main page.

Will this help?

Regards
 
Ron Perich
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem with this approach is that we need to keep the exact parameters used becuase we are using LookupDispatchActions and using a methodToCall parameter to make sure we call the correct method.

We are going to process the request to save the state in another web screen so the main screen does not change. We'll hide the new window as much as possible and we'll close it upon the request being successfully processed.

Thanks for the input.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic