-
Aug 13th, 2009, 06:51 AM
#1
Sessions between controllers
Hi,
I'm using a simple spring MVC setup with the webapp being loaded from an embedded Jetty server. I have 1 controller that handles various forms of request by extending MultiActionController. This is the process. The controllers
Load method is called, that loads some details into an object, sticks the object in the session, and then returns to the page to display the results. Some more details are entered and the controllers start method is invoked, which then makes use of the object entered into the session in the Load method.
What I'm finding is that when I open the app in two browsers, I am getting the objects in the session mixed up. Why are the sessions shared between two different browsers? How can I store an object in the session without it getting shared between two browser sessions?
-
Aug 13th, 2009, 08:34 AM
#2
My assumption you are opening a "new browser" using CTRL+N instead of really opening a new browser by clicking on the icon/menu option. (Although if you use Firefox this is also not going to work because it is detecting the current browser instance).
-
Aug 13th, 2009, 01:26 PM
#3
Hi,
You're correct! I didn't realise that double clicking firefox.exe created new browsers in the same process! Thanks very much
Also, I think Jetty allows 255 connections at the same time. Do i need to set the controller to singleton="false" to ensure each connection is served by its own instance of the controller?
Rich
-
Aug 14th, 2009, 03:07 AM
#4
If your controller is stateless it doesn't matter if it is a singleton.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules