Usually servlets are lazy-loaded, meaning, the init() method of the
servlet is not called until a user makes a request to it for the first
time.  By putting the load-on-startup with an integer as a value, then
you force the servlet to call init() on startup.  This may be
advantageous as you may want to read in configuration files or set
application properties with your servlet.

<!-- [Example] -->
<servlet>
   <servlet-name>action</servlet-name>
   <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
   <init-param>
     <param-name>config</param-name>
     <param-value>/WEB-INF/struts-config.xml</param-value>
   </init-param>
   <init-param>
     <param-name>debug</param-name>
     <param-value>2</param-value>
   </init-param>
   <init-param>
     <param-name>detail</param-name>
     <param-value>0</param-value>
   </init-param>
   <load-on-startup>2</load-on-startup>
</servlet>

Jacob Hookom
CS Student
University of Wisconsin, Eau Claire
===================================
http://www.swanked.net
you're not hip enough yet

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]

Sent: Wednesday, July 17, 2002 2:16 AM
To: Tomcat Users List
Subject: <load-on-startup> in web.xml

Hi,

What's the use of the "load-on-startup" element in web.xml?

Thanks.

Jc


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.375 / Virus Database: 210 - Release Date: 7/10/2002
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.375 / Virus Database: 210 - Release Date: 7/10/2002
 


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to