This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
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

Deprecate HttpSessionContext  RSS feed

 
v ray
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

In the project I'm working on, some deprecated Session API's have been used:




Similarly,



Also, HttpSessionContext is deprecated:



How are you guys handling session Management, when faced with similar situations? Please suggest alternatives to the above context.
From what I found on google, these API's have been made deprecated with no replacement, but I am sure there is some method to work around this.

Thanks.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would probably need to do some tracking in the background using session listeners.
 
v ray
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by David O'Meara:
You would probably need to do some tracking in the background using session listeners.


Hmm, do you have a link where I can read up on this?

Also, I found this:
http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci984536,00.html

Do you have any comments about that article?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first two methods that you've listed do have replacements.
The API tells you to use setAttribute and getAttributeNames.

For the last one, as David has mentioned the introduction of listeners has made it easy to reproduce this functionality in your own code.

Create a context listener that instanciates a map and binds it to session when you app starts up.
Create a session listener that binds sessions to to the map, using sessionId as the key, when the session is created. Make sure to also remove the reference to the session when it's invalidated.

Now you have a context scoped object with references to all of your session objects.

I haven't read the article you've posted so I can't comment on it but I do have a sample application that does just this.
http://simple.souther.us/not-so-simple.html
Look for SessionMonitor.
[ July 01, 2007: Message edited by: Ben Souther ]
 
v ray
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much!
Yeah I realized that I can use setAttribute and getAttribute instead of the putValue and getValue methods, now I'm going to try and work on implementing session listeners now.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!