[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SessionObjects





William Swaney wrote:

> Falko Braeutigam wrote:
> >
> > Rajeev, please send such questions to the list.
>
> Yes, because there just might be some Servlet experts here;)
>
> > On Wed, 05 Jul 2000, Rajeev Pillai wrote:
> > > Yes we need to store HTTP session object inside Ozone.
> > > We are trying to store the session object with
> > > sessionID (a string) as the key and all the user info.
> > >
> > > as the Session Object.
> > >
> > > We are using SessionObjects as we did not want to
> > > send all user related info. through the URL string.
> > > Therefore for  each user there is a Session Object
> > > created which has a unique SessionID which is now
> > > being
> > > passed on the URL string. Now, we want to get the same
> > > user info. using the SessionID from the
> > > URL string.
> > Hmmm.. probably I lost something and I'm by no means an Servlet expert but as
> > far as I understand the Servlet engine does the session handling for you. So,
> > something like:
> >
> >         HttpSession session = request.getSession(true);
> >         OzoneStoredUserInfo uinfo = session.getValue("sessiontest.userInfo")
>
> Just don't forget to cast the object returned by
> session.getValue(String), in this case to OzoneStoredUserInfo.  But
> other than that, Falko is right, it is the servlet engine's
> responsibility to handle sessions.  However, the question arises, do you
> want to persist your session objects?

You need persistent session objects in case you want to implement load balancing
between multiple JVMs and your servlet engine doesn't support it out of the box.

Zvi

>
>
> >
> > should work. It gets the HTTPSession out of the HTTPRequest and the associated
> > UserInfo out of the session. Since the UserInfo is a database object the
> > sessions holds just a proxy for it.
> >
> > Falko
> > --
> > ______________________________________________________________________
> > Falko Braeutigam                         mailto:falko@softwarebuero.de
> > softwarebuero m&b (SMB)                    http://www.softwarebuero.de
>
> --
> Upon seeing the box was too small, Schroedinger's Elephant breathed a
> sigh of relief.