I'am not talking about classes that i lost when i
reload my servlets...
I lost objects that i store in memory, that manage
the state of users between requests...
i just found a document in
http://www.magiccookie.com/computers/apache-jserv/#Class Path and Class Reloading
that talk about this situation...they suggest that i save
my objects in a permanent store before the reload of the
servlets, how i save objects in a permanent store ???
have somebody another solution ???
thanks for any help....
Possibly I'm confused about your question. I made a test servlet that writes init/destroy messages to the log,
and with the following doGet() method:
As you can see, it stores an object in a browser session. The first time you access this servlet from a browser, you will see something
like:
then, when you hit refresh, you'll see:
Next, if you recompile the class and copy the new version to the repository directory, and then refresh your browser once again, you will see the OLD session message and the original time, *even though* you can see in the log that the servlet instance has been destroyed and re-loaded.
So, like I said, I don't see the problem -- in JServ session data *clearly* outlives the servlet instance that created it. I believe the magic-cookie article is referring to state data that you store via instance variables in the servlet itself. Any such data would indeed be lost when the servlet is reloaded.
Good luck.
