About load-on-startup tag in web.xml in tomcat

R

ramakrishna

Hi All,
I would like to start a servlet independent of first
request.That y iam using load-on-startup tag in web.xml i.e
<load-on-startup>0</load-on-startup>.

My Requirement is when ever tomcat server starts it should load
the all the servlets independent of the first request to that servlets.

Iam using tomcat 4.0. It is not loading servlets when server is
started.

i.e Is there any element in need to set in server.xml to load
the servlets when server is started.

Thanks In Advance.
 
A

Adam Maass

ramakrishna said:
Hi All,
I would like to start a servlet independent of first
request.That y iam using load-on-startup tag in web.xml i.e
<load-on-startup>0</load-on-startup>.

My Requirement is when ever tomcat server starts it should load
the all the servlets independent of the first request to that servlets.

Iam using tomcat 4.0. It is not loading servlets when server is
started.

i.e Is there any element in need to set in server.xml to load
the servlets when server is started.

AFAIK, the load-on-startup tag only specifies the relative order of startup
of the various servlets; they do not force the servlets to startup when the
container does.

There is a listener tag you can use -- this gets webapp startup and shutdown
events. This isn't a servlet, but is part of the servlet spec. The timing of
these events is, perhaps, not strictly specified: it is not "as soon as
Tomcat starts up" but "before any request is passed to the webapp."
Depending on your needs, this may be good enough.

-- Adam Maass
 
R

ramakrishna

Thank u Adam Mass.. This is working nice.

of the various servlets; they do not force the servlets to startup when the
container does.

There is a listener tag you can use -- this gets webapp startup and shutdown
events. This isn't a servlet, but is part of the servlet spec. The timing of
these events is, perhaps, not strictly specified: it is not "as soon as
Tomcat starts up" but "before any request is passed to the webapp."
Depending on your needs, this may be good enough.

-- Adam Maass
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top