run code on deployment

Hi,

I would like to run some code when my applications gets deployed (like check some prerequisites, preload some data or initialize logging system… everything that should not be done for every user session again).
Google told me that one option is to use a ContextListener but this his to be configured in web.xml which does no longer exist for my Vaadin 7 Servlet 3.0 setup.

Whats the best nowadays solution for this (please consider that Im not an experienced programer so I need a simple solution)?

Thank you

Hi!

During Vaadin project creation (IDE Eclipse) you must only set the
Option Configuration
to Servlet 2.4 for trigger a creation of a web.xml file.

Thanks, I will take this as a fallback option.
Anyone knows how to do that with servlet 3.0?

You can create a web.xml file also on your own and place it in the WEB-INF - Folder.

I think there´s no other option than the ContextListener. I´m also using such a Listener in my App and I´m also using Servlet 3.0