Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

QUESTION ABOUT SESSION

 
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)?
 
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think yes....anybody on this issue ?
 
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.

 
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
 
Ugly Redneck
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
 
You can't have everything. Where would you put it?
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic