This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

creating two different session objects in java

 
rammie singh
Ranch Hand
Posts: 116
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi every body...

i wanted to create two different session objects . How is it possible??

what i tried was..



here the output i get is..

s1 is ... Peter
session object are equal (true/false)..true


even i am accesing "s1" with session2 object

what i want is session2 to be a different object which should give [b]"null"[b] on accesing variable [b]"s1"[b]

can any one help me how can i acheive that??
 
Rituraj Jain
Ranch Hand
Posts: 37
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi rammie,

Can you specify what is the need of doing so.

by calling methods request.getSession() or request.getSession(true);

in both cases it will return a existing session Object but if there is no existing session it will create new one for you.

if you calls request.getSession(false), it will return session object if there is already created session but it will return null if no existing session is there

in any case ony one session will be maintained not two.....
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you believe you want to create two sessions? There's only one session associated with a request.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic