In essence, your user's Session has timed out, which is why you get the null
pointer exception after some time has passed. The "time out" time period
can be set within your JSP server, should you want to extend the default
time period. For security reasons, I have set my JSP server to time out any
inactive user Session after 5 minutes. Once 5 minutes has passed, my user
must log in again.
By the way, you should have a means of determining whether the user has left
any other objects containing data open when the Session is about to time
out. If so, you may want to add code to store the information contained in
the other objects that have NOT been updated to the db, so that the user can
recover his unsaved data the next time he/she logs in.
Celeste
-----Original Message-----
From: Clemente Dani [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 22, 2001 11:30 AM
To: [EMAIL PROTECTED]
Subject: Problems with servlets, tomcat and sessions
Hi,
SORRY I YOU GET THIS MORE THAN ONCE, BUT I HAD SOME PROBLEMS.
Let's see if I can tell you my problem,....
I have a Servlet that controls the wep application, every request go to
this servlet first.
In this servlet I have an object that I put into a session instance so
it can control things like the current user id, and others.
Well, I control in the doGet method that if the session is new, so
there is "nothing" inside, I create a new instace of the mentioned
object, othewise if the object exists, I get it from the session, so
never I should get a null value.
All works fine, but when some time pass without any action from the
user, when he do a new request, a null pointer exception is thrown by
the servlet when it tries to use the instance created. More than that,
it seems like if the init() menthod of the servlet got called. Is it
possible?
I'm using tomcat 3.2
Any advice?
Thanks.
Bye, Dani
__________________________________________________________________
�Se acercan tiempos salvajes a Navegalia : el planeta de los simios
ya est� aqu�!
La 20th Century Fox, Qtal de Airtel y Navegalia, te tienen preparadas
una serie de sorpresas en este mundo inh�spito. Hay miles de regalos
esper�ndote. P�sate por
http://www.navegalia.com/portal/promos/planetasimios/index.htm y
cons�guelos.
==========================================================================To
unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
==========================================================================To
unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets