• 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

Deprecate HttpSessionContext

 
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
If you were a tree, what sort of tree would you be? This tiny ad is a poop beast.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic