struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
Subject Re: Hook to bootstrap in Tomcat
Date Thu, 01 Mar 2001 04:45:02 GMT
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



Mime
View raw message