• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Session Creation Time

 
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 .
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic