Question

I have an options menu, over a jsp page, on which users explore items, that have sub-items, that have sub-sub-items and so on. Items are collapsable, so the user can see the hierarchy of the items he want.

The menu is expanded manipulating the css using javascript and jquery.

This menu is shown on all the pages of the application, and, every time the users goes to a new page, the menu, must be shown as the user left it on the previous page (all the menu items that the user expandend must be remembered).

He can change page by submiting a form, following a link, or going back on the browser.

How can this be donde? Is uploading the HTML portion of the menu to the session a viable solution? Cookies perhaps? Or there is a better way ?

PS: also struts2 is used on the application.

Was it helpful?

Solution

Make a few java classes that represents (Menu, MenuItem) and store them in the session on the server. Assign each menu-item a unique integer id, and submit this id to the server when the user clicks on it. You can use jsp to render the menu in its current state based on the java classes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top