• 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

query related to sessions

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can anyone tell me the difference between attributes stored in session object and attributes in a request object with a practical example ?
 
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Request attributes are available for only that particular request.

Session attributes are accessible and usable throughout the life of a session.
[ October 20, 2005: Message edited by: Vishnu Prakash ]
 
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The difference is of the scope of the atribute . If you set an attribute in the request , then it will only be visible to the component having access to that request. for example


In a servlet is you set an attribute 'A'in the request and attribute 'B' in the session then attribute 'A' will be accessible to the JSP/Servlet having that request object,as http is a stateless protocol, there will be new HttpRequest for each request of any component from the server, Attribute 'B' will be accessible to all the request from same client, as all the request from the sam client will use a single session object on the server side.
 
Could you hold this puppy for a sec? I need to adjust 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