You could create a SetupServlet (that instantiates objects and stores them
in Application context) which is initialised by the container at startup.
You'd declare this requirement and pass parameters to the servlet (EJB
compliant setter methods are required) via the web.xml file. In web.xml
you'd have something like this:
<servlet>
<servlet-name>setup</servlet-name>
<servlet-class>au.com.nationalmortgage.alladin.servlets.SetupServlet</servle
t-class>
<init-param>
<param-name>driverMSQL</param-name>
<param-value>com.merant.datadirect.jdbc.sqlserver.SQLServerDriver</param-val
ue>
</init-param>
<init-param>
<param-name>serverMSQL</param-name>
<param-value>jdbc:sqlserver://192.168.0.2:1433</param-value>
</init-param>
<init-param>
<param-name>logFileMSQL</param-name>
<param-value>/home/virtual/domains/somewhere.com/www/WEB-INF/logs/brokerMSQL
.log</param-value>
</init-param>
<init-param>
<param-name>loginMSQL</param-name>
<param-value>www</param-value>
</init-param>
<init-param>
<param-name>passwordMSQL</param-name>
<param-value>na710nal</param-value>
</init-param>
<init-param>
<param-name>minConnsMSQL</param-name>
<param-value>4</param-value>
</init-param>
<init-param>
<param-name>maxConnsMSQL</param-name>
<param-value>20</param-value>
</init-param>
<init-param>
<param-name>maxConnTimeMSQL</param-name>
<param-value>1</param-value>
</init-param>
<load-on-startup/>
</servlet>
You could alternatively name and instantiate JNDI resources - as in the
Tomcat 4 documentation - I think this is much tidier.
----- Original Message -----
From: "Egil Rian" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 16, 2002 3:00 PM
Subject: starting up tomcat and a web application at the same time
> I have written an application that requires some data structures to be
> initialized before the first request comes in to my application via the
web.
> The way I have it set up now is so that the initialization takes place
when
> the first request comes in.
>
> I would like to be able to start up my application (i.e. do the
> initialization process) at the same time as Tomcat starts up. How do I do
> this?
>
> I am using Tomcat 3.2.3, and I compile my classes using JDK1.2.
> JAVA_HOME is JDK1.4
>
> Thanks,
>
> Egil Rian
>
>
>
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos:
> http://photos.msn.com/support/worldwide.aspx
>
>
> --
> To unsubscribe: <mailto:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>
>
>
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>