• 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

life span of HttpServletRequest and HttpServletResponse

 
Ranch Hand
Posts: 371
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I was wondering about the life time of a HttpServletRequest object. I think it is longer than that of a HttpSession object, since a HttpSession is stored in a HttpServletRequest object. Then when is HttpServletRequest destroyed or expire?
On the same token, how long is the life span of a HttpServletResponse object? When will it expire?
 
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The lifetime of an HttpServletRequest object is a single request (which may include forwarding to another page). The lifetime of an HttpSession object is dependent on the server settings (usually about 15min or less - for a single user session).
I think what may be confusing you is the reference to the session object from within the request. The current user session is associated with the request, but is not part of the request. The actual session objects are managed by the session manager part of the servlet container.
Hope this clears things up

------------------
Chris Stehno (Sun Certified Programmer for the Java 2 Platform)
 
I promise I will be the best, most loyal friend ever! All for this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic