Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

code to get entire session  RSS feed

 
Rajendra Prakash
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In session , we can use getAttribute and setAttribute methods to get and set attributes from one servlet to another.
Is it possible to get entire session to some other place.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's what request.getSession() does. It gets the "entire session".
 
Campbell Ritchie
Sheriff
Posts: 55344
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not a "beginning" topic. Moving thread.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Always keep in mind that session objects are managed by the container (just like request and response objects)

You should NEVER NEVER try to keep a copy of a session reference longer than a single request/response cycle.

Bill

 
Kris Schneider
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William Brogden wrote:You should NEVER NEVER try to keep a copy of a session reference longer than a single request/response cycle.


+1
Nor should you use that reference outside of the request-handling thread...
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!