Execute code when Vaadin is started

How would I go about having a certain piece of code executed as soon as my Vaadin application is started? I have found the servletInitialized() method, but this requires the page to be requested before the code is executed. Is what I need possible?

Hello,

You can do that with a ServletContextListener :
https://www.mkyong.com/servlet/what-is-listener-servletcontextlistener-example/
(or with the annotation @WebListener )

Or with a simple servlet with auto-load set to true
http://javarevisited.blogspot.be/2011/12/load-on-startup-servlet-webxml-example.html

Regards
Sebastien

Thank you, this helped me!