tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kitching Simon <>
Subject RE: context initialization
Date Wed, 27 Dec 2000 10:16:23 GMT
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