Win a copy of Microservices Testing (Live Project) this week in the Spring 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Q. HttpSession object

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Book : Java 2 Web Component Developer [Levi, Sybex]
An HttpSession object is created when a user sends its first request
to an application. The object is maintained on the server end and can be
configured to track each action the user takes while at the site. Remember,
with HTTP, each request/response transaction creates a new object.
Q. I don't understand the "remember"-part of this piece of text. Will an object be created each time you send a request / respond? Or will only one be created (the first time the user sends its first request)?
 
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Remember, with HTTP, each request/response transaction creates a new object.
Q. I don't understand the "remember"-part of this piece of text. Will an object be created each time you send a request / respond? Or will only one be created (the first time the user sends its first request)?[/QB]


The way I read it is that a new Request & Response object will be created for each HTTP request therefore any attributes that you assign to these objects will NOT be persisted between requests.
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes you are right Andy. It refers to the creation of new request - responce object, for each new request, the session remaining the same.
yogen
 
Karin Paola Illuminate
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys. It is clear to me.
 
I am displeased. You are no longer allowed to read this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic