Return-Path: Mailing-List: contact struts-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list struts-dev@jakarta.apache.org Received: (qmail 54033 invoked from network); 1 Mar 2001 04:42:37 -0000 Received: from mercury.sun.com (192.9.25.1) by h31.sny.collab.net with SMTP; 1 Mar 2001 04:42:37 -0000 Received: from centralmail1.Central.Sun.COM ([129.147.62.10]) by mercury.Sun.COM (8.9.3+Sun/8.9.3) with ESMTP id UAA27283 for ; Wed, 28 Feb 2001 20:42:43 -0800 (PST) Received: from esun1as-mm. (esun1as-mm.Central.Sun.COM [129.147.34.144]) by centralmail1.Central.Sun.COM (8.9.3+Sun/8.9.3/ENSMAIL,v2.1p1) with SMTP id VAA13470 for ; Wed, 28 Feb 2001 21:42:43 -0700 (MST) Received: from eng.sun.com by esun1as-mm. (SMI-8.6/SMI-SVR4) id VAA23069; Wed, 28 Feb 2001 21:43:26 -0700 Message-ID: <3A9DD3CE.53EC1B47@eng.sun.com> Date: Wed, 28 Feb 2001 20:45:02 -0800 From: "Craig R. McClanahan" X-Mailer: Mozilla 4.76 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: struts-dev@jakarta.apache.org Subject: Re: Hook to bootstrap in Tomcat References: <4.3.2.7.2.20010227184304.00de6830@pigeon.tumbleweed.com> <4.3.2.7.2.20010227194845.00c5b9e0@pigeon.tumbleweed.com> <3A9CA3A5.FDA46AB0@cortexebusiness.com.au> <3A9DCAB3.3F1663E1@eng.sun.com> <002801c0a208$71a59910$5a41a8c0@frontier> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Qiqi Dong wrote: > Does anyone know how to bootstrap my own classes when start Tomcat. Does > Tomcat actually provide a hook for that? Qiqi, the best place to ask this is on the TOMCAT-USER list, rather than the two lists you selected. However, to save the trouble of re-asking, the answer varies by Tomcat version: * In Tomcat 3.x (based on servlet 2.2), about the only way to bootstrap your own classes is to create an initialization servlet, and mark it . Then, in the init() method of this servlet, instantitate and configure your user objects as needed. * In Tomcat 4.0 (based on servlet 2.3), you can do the above. Or, you can use the new "application event listeners" model to create an object that is notified when your webapp is started (and shut down), and can perform appropriate initialization for you. Craig McClanahan