that will not work from a war file, cause you only get a facade to the actual session. in order to serialize a session you need access to the tomcat internal classes.
what I suggest you do though is that you create session attribute listeners and store your sessions there. there should also be activate/passivate events that allow you to intercept these Filip -----Original Message----- From: Johan Wasserman - CPX Mngd Services [mailto:[EMAIL PROTECTED] Sent: Friday, April 16, 2004 1:41 AM To: Tomcat Users List Subject: RE: Session persistance Any luck Anu? I have exactly the same request... I need to serialize the session (HttpSession to a byte array) and save it to a blob in MySql (i use Hibernate). I have tried, for example; ... ByteArrayOutputSream baos = new ByteArrayOutputstream(); ObjectOutputStream oos = new ObjectOutputStream(boas); oos.writeObject(session); //<-- it fails here, nothing in the logs byte[] sessionAsBytes = baos.toByteArray(); ... I need this to give the user the option to restore a previous session (where they where before they last logged out, with all the session variables required to restore to that point). I guess that's what you need it for as well. By the way, hibernate's createBlob also doesn't do he trick. Something to do with the session. I'm thinking of creating a bean (and store it in session) to keep track of my app and then just serializing/deserializing that bean from/to the session on logout/login. I prefer the session though. Thanks, Johan. -----Original Message----- From: Anu Mathew [mailto:[EMAIL PROTECTED] Sent: Friday, April 16, 2004 7:37 AM To: Tomcat Users List Subject: Re: Session persistance I already RTFM. From the manual I understood that you are also part of developing TFM. But in TFM, restoring of the session is mentioned as automatic when the applicatio/server restarts. But I want to control both storing and restoring of the session using my code. Is this possible? Thanks, Anu Mathew ----- Original Message ----- From: "Shapira, Yoav" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Thursday, April 15, 2004 6:45 PM Subject: RE: Session persistance > > Hi, > > >I need to > >1. Store the session object in a database (I can trigger this > >operation from a jsp say logoff.jsp ) 2. Retrieve the session object > >from the database (I can trigger this operation from a jsp say > >login.jsp ) > > > >Thoughts?? > > Here's one thought: RTFM. JDBC store for sessions: > http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/manager.html > > Yoav Shapira > > > > > This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.654 / Virus Database: 419 - Release Date: 4/6/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.654 / Virus Database: 419 - Release Date: 4/6/2004 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
