> From: Justin Randall [mailto:[EMAIL PROTECTED] > Subject: RE: Tomcat 6.0.18 Servlet Loading/Reloading > > Basically when I restart Tomcat, it doesn't call any of the > "init" methods of the Servlet
Unless you have <load-on-startup> set for the servlet in your webapp's WEB-INF/web.xml, that is correct behavior for a Tomcat restart. The init() method (there can only be one per servlet) should be called upon first reference to a URL that matches a <url-pattern> element inside one of your <servlet-mapping> elements. If <load-on-startup> is set, the init() method will be called at Tomcat restart for each such servlet. > however all of the initialization which was to be > performed by the "init" methods was never done. You keep using the word "methods" when there is only one init() method for a given servlet; why is that? > When I copy the existing war file from the webapps directory > to another location, update the modify timestamp and then > move it back into the webapps directory, the "init" methods > are then called and the application works properly. This is also correct behavior for initial or re-deployment. Although the spec doesn't require it, Tomcat calls the init() methods to verify webapp viability at these times. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]