If I enable automatic servlet reloading for a webapp, will the init() method of the servlet get executed for each automatic reload?
Location: http://www.jguru.com/faq/view.jsp?EID=113527 Created: Jul 28, 2000 Modified: 2000-07-29 05:16:12.876 Author: Avi Kak (http://www.jguru.com/guru/viewbio.jsp?EID=26410) Yes. This question is important because it is possible to misconstrue the community literature dealing with servlets and believe that the init() method of a servlet will get executed only once — the first time a servlet gets loaded into the container. The following simple servlet, called TestServlet, can be used to verify the answer to the question. In my Tomcat 3.1 container, this servlet is inside a webapp called test-suite and resides in the directory TOMCAT_HOME/webapps/test-suite/WEB-INF/classes In accordance with the jGuru FAQ posting, I have enabled automatic reloading for this webapp by including the following element in the server.xml file in the TOMCAT_HOME/conf directory:
Related Questions
- If I enable automatic servlet reloading for a webapp, will the init() method of the servlet get executed for each automatic reload?
- When using URLConnection to upload an object from applet to servlet, the servlets doGet method is never executed. Why?
- Why do we need a constructor in a servlet if we use the init method?