Re: deprecated servlet session management: getSessionContext();
From: david (abuse_at_yahoo.com)
Date: 10/07/03
- Next message: Dobromir Gaydarov: "Re: Will the new Generics mechanism still use runtime casting?"
- Previous message: m rouch: "16 bit PCM to wav file conversion"
- Next in thread: Erwin Moller: "Re: deprecated servlet session management: getSessionContext();"
- Reply: Erwin Moller: "Re: deprecated servlet session management: getSessionContext();"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 07 Oct 2003 01:18:50 GMT
"Erwin Moller"
<since_humans_read_this_I_am_spammed_too_much@spamyourself.com> wrote in
message news:3f7a90f6$0$58707$e4fe514c@news.xs4all.nl...
> david wrote:
>
> > Per the documentation
> > HttpSessionContext context = session.getSessionContext();
> > is deprecated due to security reasons and there is no specified
> > replacement. The Java Servlet Programming book had a prototype session
> > management code segment that has been useful. How do we do session
> > management now? Where are good tutorials/code segments which will
perform
> > session management similarly to the previous method?
> >
> >
>
> Hi David,
>
> Maybe this can help you:
>
> implements HttpSessionBindingListener
>
> If you use HttpSessionBindingListener on ANY class, two methods will be
> called:
>
> public void valueBound(HttpSessionBindingEvent sbe){
> // called when this object is bound to a session
> // use sbe.getSession() to get the session.
> }
>
> public void valueUnbound(HttpSessionBindingEvent sbe){
> // called when object is unbound to session
> }
>
>
> From session you can get the ServletContext like this:
> sbe.getSession().getServletContext()
>
> I think if you define an object in the ServletContext that handles all
> sessions, you can code the functionality you are looking for.
>
> Good luck,
> Erwin Moller
>
Thanks... can you point to any good articles/books/texts that discuss
"replacement" techniques (i.e. deprecated API -> new API) for session
management.
- Next message: Dobromir Gaydarov: "Re: Will the new Generics mechanism still use runtime casting?"
- Previous message: m rouch: "16 bit PCM to wav file conversion"
- Next in thread: Erwin Moller: "Re: deprecated servlet session management: getSessionContext();"
- Reply: Erwin Moller: "Re: deprecated servlet session management: getSessionContext();"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|