Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

If I enable automatic servlet reloading for a webapp, will the init() method of the servlet get executed for each automatic reload?

0
Posted

If I enable automatic servlet reloading for a webapp, will the init() method of the servlet get executed for each automatic reload?

0

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: As the following code shows, the

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123