• 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

Session Creation Time

 
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

getCreationTime() of HttpSession returns the time of creation of Object in milliseconds
My q is , does web-container creates a HttpSession for first resquest from client regardless of :
- if it is a request for static-resource , like static HTML page , image etc
- if it is a request for dynamic-resource , servlet/jsp page dat is
OR session is ONLY created for first request of dynamic-resource ?

------------------
Gagan (/^_^\) SCJP2
Die-hard JavaMonk -- little Java a day , keeps u going .
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Neither. A session is created the first time you request it, i.e. calls request.getSession() or request.getSession(true). Note that JSPs use sessions by default, but you can disable this.
In the last public-facing web site I did, we purposefully used 'session="false"' on the opening page to improve the scalability of the server somewhat: we didn't need any sessions for that page, and wanted to avoid creating sessions for users that never click through to the rest of the site.
- Peter
 
Gagan Indus
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankx Peter !
wid ur real-life example , i think i never gonna forget it now ! 10x
------------------
Gagan (/^_^\) SCJP2
Die-hard JavaMonk -- little Java a day , keeps u going .
 
On top of spaghetti all covered in cheese, there was this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic