views:

703

answers:

1

I have a web application (Java, Websphere, JSP) which allows co-workers to register visitors to various company exhibitions. A user object is stored in the session which records the currently selected exhibition and this is used when entering the details of new visitors.

One user has decided to open a second browser window which seems to share the same session. The user browses to an other exhibition in the second window. This changes the state of the currently selected exhibition. Back in the first window a menu item is clicked: 'List visitors'. The resulting list is a list of visitors to the exhibition selected in the second window.

I know that I could add the exhibition id to every form on every page but my actual scenario is more complicated that the one I have described.

What is your stategy for dealing with this kind of problem?

+1  A: 

My first guess would be you can avoid the problem by keeping (or perhaps only identifying) view state in the URL and not the session.

Aram Verstegen
As I mentioned there are quite a number of variables assoicated with the user object which may change. That would make the URL quite cumbersome
paul
Right, would it be possibly to only identify a view state, which is then expanded upon by the backend?
Aram Verstegen
Ok, I see what you're getting at. Some kind of unique id which identifies a state at some point in time. That might help...
paul
Exactly. Good luck! :)
Aram Verstegen