But what about executing the init() method when the servlet was already 
loaded?, why does this happen?

I'm getting printed the session Id, and is the same after and before 
this occurs, so I suppose that the session is the same.

And the questios is that if the session was expired, I create a new 
object, so is "not possible" that I get a null object, see the code:

///// BEGIN SLICE OF JAVA CODE

  HttpSession sesion = request.getSession(true);
  System.out.println(sesion.getId());
      
  if (sesion.isNew()) {
      control = new ControladorSesion();
      sesion.setAttribute("CtlSesion",control);
  }
  else {
      control = (ControladorSesion)sesion.getAttribute("CtlSesion");
  }

..... and it fails ....:


  boolean repetir = (control.getSecuencia() >= secuencia);


///// END SLICE OF JAVA CODE


thanks a lot for your time.

Bye, Dani




----- Missatge Original -----
De: "Haseltine, Celeste" <[EMAIL PROTECTED]>
Data: Dimecres, Agost 22, 2001 8:54 pm
Assumpte: Re: Problems with servlets, tomcat and sessions

> 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 
> periodcan 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



__________________________________________________________________
�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

Reply via email to