0

I am running Tomcat 9 with Sring 5.0.4 and Jdk 1.8 Need to execute code after ServletContext initialization is completed.

I have tried

<load-on-startup>1</load-on-startup>

for a servlet and tried executing my code from its init method. However, this is executed before I see the below line in logs

org.apache.catalina.startup.Catalina.start Server startup

I have also encountered the below solution on this forum to annotate a method, but it's applicable only for spring boot.

@EventListener(ApplicationReadyEvent.class)

Any pointers to an equivalent solution in spring will be really greatful

Sunil
  • 364
  • 1
  • 14
  • Does this [answer](https://stackoverflow.com/a/39967690/4214241) help ? – R.G Feb 08 '20 at 00:18
  • Not exactly, I am looking for an event that I can capture once Context Initialization has completed. – Sunil Feb 12 '20 at 06:30

0 Answers0