Originally posted by Charith Fernando:
Thanks.
summary would be... if u change a jsp page while the server is running it destroys the current instance of the jsp and makes a new one.. but for servlets it uses the same old instance..
Yes, this is a good summary.
The servlet spec also includes a provision for the web container to monitor when servlet .class files change and to reload these servlets dynamically. In that situation, the old servlet instance is destroyed and then the web container loads the new class, creates an instance, initializes the servlet instance, and then makes it ready to recieve new requests. This mechanism (which is virtually identical to the JSP reloading mechanism) is optional in the spec so not every container supports this mechanism. I believe that Tomcat supports servlet class reloading, but I have not personally tried it.
HTH,
Bryan