This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

about sessions

 
sureshreddy puli
Greenhorn
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

I am new to servlets.Please tell me the difference between

application.setAttribute(....)
session.setAttribute(....)
request.setAttribute(....)

And exactly the need of thees three.That is when should i use each.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Refer to the servlet specs.
There is no other better substitute.
[ October 05, 2005: Message edited by: Adeel Ansari ]
 
Scheepers de Bruin
Ranch Hand
Posts: 99
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
application.setAttribute(....)
These attributes are accessable and usable throughout the life of the web application, and is shared by all sessions (a session starts when the app receives the first request from a user, and ends when they log off, close their browser, or the session expires i.e.the server does not receive requests from the user for a preset time).

session.setAttribute(....)
These attributes are accessable and usable throughout the life of a session.
They are isolated from other sessions (i.e. one user's session is completely seperated from anothers)

request.setAttribute(....)
These attributes are only valid and usable for the duration of one request (i.e. from the user requests some url, until the server has finished responding)
[ October 05, 2005: Message edited by: Scheepers de Bruin ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic