title: ServletContextListener is stopping the deployment of Web Application on Apache Tomcat
body: <p>I have implemented a ServletContextListener in Simple java class.Now inside this i have called a method to execute as soon as contextInitialized of ServletContextListener  runs.The nature of called method is that it is complex and takes long time hours to execute.
  There is only one web page called index.jsp which is welcome page that needs to displayed on browser as soon as web application runs but this is not displaying as first called method executes and it takes long time to execute..</p>
  
  <p>I need welcome page to display and function called in ServletContextListener to execute in background ..</p>
  
  <p>Here is my ServletContextListener  class..</p>
  
  <pre><code>public class Startup implements ServletContextListener
  {
  @Override
  public void contextDestroyed(ServletContextEvent sce) {}
  
  @Override
  public void contextInitialized(ServletContextEvent sce)
  {
      // Do your startup work here
       executeprocess();
  }
  
  }
  </code></pre>
  
  <p>and here is my web.xml file..</p>
  
  <pre><code> &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
  &lt;/welcome-file-list&gt;
   &lt;listener&gt;
      &lt;listener-class&gt;org.myapp.Startup&lt;/listener-class&gt;
  &lt;/listener&gt;
  </code></pre>
  
  <p>Please help me.
  Thanks in advance..</p>