Create a servlet which implements the Runnable interface. In this
servlet's init() method create and start a Thread which does whatever
processing you need.
To load it when the servlet container starts, add something like this to
web.xml:
<servlet>
<servlet-name>myServlet</servlet-name>
<servlet-class>com.foo.MyServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
-Steve
Ganesh MohanRao wrote:
> Hi,
>
> Please tell me how to make a Servlet Run till the lifetime of Webserver.
>
> Whenever the webserver starts, Servlet needs to start and should run till
> the Webserver shuts down.
>
> Please help me.
>
> Thanx.
>
> Ganesh
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets