I do this always. My methodology is to take the
object
sesion.getAttribute("object");
to do the changes...
save the object:
sesion.setAttribute("object",object2);
Write the values:
out.write(HTML_OUT);
Sometimes it runs as good as I expect. If I
put an sleep(1000), then it always runs well.
----- Mensaje original -----
Enviado: martes, 16 de abril de 2002
15:24
Asunto: Re: problem with session
objects
José,
Before closing the first PrintWriter, you have to
do a "setattribute", to store your session object.
Franck
----- Original Message -----
Sent: Tuesday, April 16, 2002 2:56
PM
Subject: Re: problem with session
objects
Jose,
Could you post the code in your HTML page, I'm
curious as to how your calling two servlets from the same
page.....
Robin
Hello,
I have a problem with servlets and session
objects and I don't know how I can solve it.
From a html page I call a servlet for
modifying the content of a session object. Immediately after, the html
calls other servlet that it returns the data it finds in the session
object.
the problem is that Sometimes the servlet
returns the values of the lastest session object. In this case, its like
the second servlet had used the previous version of the session
object.
I have solved the problem stopping the
execution during 1 sec. to allow to save the session object but I thing
it's wrong because I'm penalizing the execution.
Always I use the methods getAttribute() and
setAttribute() for using the object.
How can I to synchronize
this?
|