Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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 .
 
What's that smell? Hey, sniff this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic