aspose file tools*
The moose likes JSP and the fly likes session out problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "session out problem" Watch "session out problem" New topic
Author

session out problem

Rubel Ahammad
Greenhorn

Joined: Feb 05, 2005
Posts: 19
dear friends,
i'm new to jsp. i'm facing a strange problem. i have an index page where i wrote the code for user authentication. after i login to the application if i dont work with that application for a certain amount of time say 10 min ( the time that has been set in the web.xml file under session-timeout tag), i'm redirected to the index page if i send any request for a new page. then i need to relogin. but i want the session to be backed up before it expires and wish to retrieve some information from that session object. so that i can reuse that information in index.jsp page and based on that information i wish to redirect the user to some other page.

can anybody help me out to save session object in a SQL server db. and retrieve that .


thanks in advance.


rubel ahammad<br /> <br />SCJP 1.4 (91%)<br />SCWCD 1.4 (Preparing)
Rubel Ahammad
Greenhorn

Joined: Feb 05, 2005
Posts: 19
i'm using tomcat 4.1.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
Your best bet is NOT to try to save the session object - there is no user interface for restoring a session from outside the servlet container.

Instead, incorporate the information in a Plain Old Java Object (POJO) that is Serializable and store the reference to the POJO in the session. Also save the serialized object to a database or file system whenever the data changes. With a POJO you can test your save/restore code outside the JSP environment and if you use JavaBeans conventions you can use the various JSP shortcuts for beans.
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: session out problem