tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antony GUILLOTEAU <>
Subject Rép. : Executing custom action on deploy
Date Tue, 11 Oct 2005 09:37:31 GMT
In your web.xml file, declare a servlet like this : 


And in your servlet, the init() method is called when the server start : 

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class myServletextends HttpServlet
  /** Init */
  public void init(ServletConfig config) throws ServletException
    // do your action

  public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException,
   // ...



>>> 07/10/2005 18:32:03 >>>

I'm writing a web application for tomcat and I have a strange request:
I would like to execute an initializing function in order to
initialize correctly my applicaiton when it becomes available
(deployed into tomcat or tomcat itself is started)

I have written such behaviour in a method, so what can I do to execute it?

Thanks for your help, Matteo

To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message