Topic: when is the method Destory() invoked in Servlet |
Print this page |
1.when is the method Destory() invoked in Servlet | Copy to clipboard |
Posted by: eqq2002 Posted on: 2006-12-16 10:54 I post it here because I consider it is a basic question.It is said Java can destruct all objects automaticlly. So the most confused thing for me is why we still need destory(). When I started to study a couple of examples in javax.servlet.*; I found out some real reasons, you can save to local disk/medium the information as state descriptor or teminate a thread. Then comes the doubt, when Destory() is invoked in Servlet? It is the time that the my Servlet class is recompiling so Tomcat5.0(for example ) have to do that before load a new one, or the time Tomcat shutdown, or I invoke it by my other classes? Are these mentioned above right?And are there other situations? Especially the invoker is the Tomcat it self! By the way,When the Tomcat Collapse suddenly , invoking seems not happen。 |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |