You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Qiqi Dong <qd...@swbell.net> on 2001/03/01 05:31:11 UTC

Hook to bootstrap in Tomcat

Does anyone know how to bootstrap my own classes when start Tomcat. Does
Tomcat actually provide a hook for that?




Re: Hook to bootstrap in Tomcat

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
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 <load-on-startup>.  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