tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolás Marjovsky <>
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,

----- Original Message -----
From: "Kitching Simon" <>
To: <>
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

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


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);



> -----Original Message-----
> From: Nicolás Marjovsky []
> Sent: Tuesday, December 26, 2000 10:40 PM
> To:
> 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

View raw message