title: Callback method after ServletContext is initailized in tomcat
body: <p>I am running  Tomcat 9 with Sring 5.0.4 and Jdk 1.8
  Need to execute code after ServletContext initialization is completed.</p>
  
  <p>I have tried </p>
  
  <blockquote>
    <p><code>&lt;load-on-startup&gt;1&lt;/load-on-startup&gt;</code></p>
  </blockquote>
  
  <p>for a servlet and tried executing my code from its init method. However, this is executed before I see the below line in logs</p>
  
  <blockquote>
    <p>org.apache.catalina.startup.Catalina.start Server startup</p>
  </blockquote>
  
  <p>I have also encountered the below solution on this forum to annotate a method, but it's applicable only for spring boot.</p>
  
  <pre><code>@EventListener(ApplicationReadyEvent.class)
  </code></pre>
  
  <p>Any pointers to an equivalent solution in spring will be really greatful </p>