tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolás Marjovsky <nmarj...@insite.com.ar>
Subject Re: context initialization
Date Thu, 28 Dec 2000 18:56:38 GMT
Dear Simon:
    I've tried what you told me but the servlet doesn´t gets executed, it´s
just preloaded.

Any ideas?

Thanks for your help,
Nicolás

----- Original Message -----
From: "Kitching Simon" <Simon.Kitching@orange.ch>
To: <tomcat-user@jakarta.apache.org>
Sent: Wednesday, December 27, 2000 7:16 AM
Subject: RE: context initialization


If I understand your question correctly, I do this sort of
thing currently, by having a servlet which instantiates
a bunch of objects, and adds them to the context.
This servlet is defined as "load-on-startup".


In the webapp's web.xml, I have:

    <!-- define a servlet/class that can be accessed by all other components
-->
    <servlet>
        <servlet-name>initializerServlet</servlet-name>
        <servlet-class>orange.ola3.InitializerServlet</servlet-class>
        <load-on-startup>1</load-on-startup>

        <init-param>
          <!-- set system state mode. Valid values are:
               PRODUCTION, TEST, DEBUG
          -->

          <param-name>systemStateMode</param-name>
          <param-value>DEBUG</param-value>
        </init-param>
    </servlet>

In reality, I have a whole bunch more init-param tags, containing things
like JDBC connection strings.
The servlet code itself does a bunch of things like:

          systemState = new SystemState();
          context.setAttribute("systemState", systemState);

Regards,

Simon

> -----Original Message-----
> From: Nicolás Marjovsky [SMTP:nmarjovs@insite.com.ar]
> Sent: Tuesday, December 26, 2000 10:40 PM
> To: tomcat-user@jakarta.apache.org
> Subject: context initialization
>
> Hello,
> I need to put some static objects into a web application context at
> start-up time... I want to set the context when the application is going
> up. Where should I put this? In web.xml?
>
> Thanks,
> Nicolás



Mime
View raw message