• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

QUESTION ABOUT SESSION

 
jeffrey z. lee
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
object hts is created with <%HttpSession hts=pageContext.getSession();%>, is this object (hts) identical with the implicit object(session)?
 
Nazmul Huda Sarkar
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think yes....anybody on this issue ?
 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
+1
from javadoc :
getSession()
Returns the current session associated with this request, or if the request does not have a session, creates one.
 
Thomas Hubschman
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep.
All you are doing is getting a different reference to the same object. The implicit object reference is session, your reference is hts.
Evaluating ( hts == session ) should resolve to "true."
Hope this helps.
Thomas
 
Paul McKenna
Ugly Redneck
Ranch Hand
Posts: 1006
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There can be only one session object per client at any given instance. Also another thing to note is that the command issued is 'getSession()'
Which means true is assumed by default
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic