tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phillip Morelock <subscripti...@phillipmorelock.com>
Subject Re: Init object in contextServlet
Date Thu, 06 Jun 2002 09:58:18 GMT
Hey,

Write a servlet that does this.

Extend
javax.servlet.http.HttpServlet

override the "init" method.

in this init method, do whatever it is you're doing.

In web.xml, declare this servlet like usual and put in a load-on-startup
tag.  

<servlet>
    <servlet-name>DataInitServlet</servlet-name>
 <servlet-class>com.xxx.memphis.util.DataInitServlet</servlet-class>
    <load-on-startup>5</load-on-startup>
   </servlet>

The number in load on startup indicates in what order to load them -- if I
recall correctly, lower numbers go first.

cheers
fillup


On 6/6/02 2:53 AM, "Aline" <aline@webcaster.fr> wrote:

> Hi,
> 
> Can anyone tell me how to create an object instance and put it in the
> servlet context at the beginning of a web application.
> 
> Is it in the web.xml that I must declare it?
> 
> thanks.
> Aline
> Webcaster
> T +33 (0)3 28 36 25 23
> F +33 (0)3 20 13 06 04
> http://www.oeilpouroeil.fr
> http://www.visiodrome.com
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message