William Brogden wrote:a) only the servlet container should call destroy as part of the life cycle.
It is up to the servlet programmer to code the destroy method to clean up any resources used. Be careful, check for null ref before trying to - for example - close database connections.
b) 1. say servlet class instance, not servlet class - using the right words helps understanding
....2. actual cleanup is up to the servlet container and jvm
OK. So, as far as the init() and destroy() methods are concerned, it is up to the servlet container and the JVM do decide when to initialize and destroy the servlet instance. Correct?