wood burning stoves
The moose likes Struts and the fly likes Table navigation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Table navigation " Watch "Table navigation " New topic

Table navigation

Michael Swierczek
Ranch Hand

Joined: Oct 07, 2005
Posts: 125

I'm working on medical test software. You log in, and you have a number of menu choices on the left: Patients, Reports, Clinicians, etc...

Let's say a user clicks Patient, pages through the table to the third set of entries, clicks Reports, and then clicks back on Patient. By default, they get returned to the first page of the Patient table again. It would be much more convenient for them to be returned to the page of Patient they were most recently on.

I have a working solution, but it seems a little awkward and I'd like to see if something more straightforward exists.
Create a session attribute "menu locations" that is a Map. The Map keys are the menu choices, "Patients", "Reports", "Clinicians", etc... The Map values are the most recent HttpServletRequest.getQueryString() values when the user navigated through the corresponding menu. Each time the user clicks a menu item, check the request query string. If it is non-null, simply save it in the session Map and continue normally. If it is null, check the session Map for a value for that menu. If you find one, forward to that location.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864

I don't see anything wrong with your solution. I know we're always our own worse critics, but from my point of view, it doesn't look awkward at all.

Consultant, Sima Solutions
I agree. Here's the link: http://aspose.com/file-tools
subject: Table navigation
It's not a secret anymore!