*
The moose likes Servlets and the fly likes How to open another window without using the same session? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to open another window without using the same session?" Watch "How to open another window without using the same session?" New topic
Author

How to open another window without using the same session?

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
How can I open another window without using the same session as the one which is already open? In other word, how can I assoziate different Sessions to the different windows from the same browser instance?
thanks,
Sam
Brian Nice
Ranch Hand

Joined: Nov 02, 2000
Posts: 195
I'm not sure if you can have two sessions or not, but you could probably fake it. In the session object, place a collections item like a HashMap. On the first page, whatever information you need to store, put in a Vector or something and then put that vector in the HashMap as "page1"
Now when you are on the second page, look for something in the session called "page2". if it doesn't exist, then you can create a new Vector to store information related to this page and put this in the HashMap as "page2"
Now whenever you need to access "session #1" variables, get the Vector out of the hashmap for page1. the same for page two.
Hope that helps
Brian
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Thanks Brian, it helped me to solve the problem.
Sam
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to open another window without using the same session?
 
Similar Threads
How to persist data of child window form
Session Attributes - thread safe ?
HFSJ Final Mock Question 47
Are session attribute not thread safe? p-199 on HFSJ
Servlet session