tags:

views:

44

answers:

2

I am wondering if/where I can put some code to run the VERY first time the Vaadin server is initialized? (Not the first time a user hits the site)

(For example for loading proxy settings from files, starting rss crawlers etc.)

It's quite possible I'm missing a trick with the JavaEE stuff here, I'm pretty new to this stuff.

+1  A: 

Use ServletContextListeners. It's an interface whose contextInitialized method is called everytime the server is started. They are really simple to use, just implement the interface and add your context listener to the web-xml, see this example.

Kim L
A: 

Another way would be to extend ApplicationServlet and override the init() method. Then you have to modify your .xml file to point to this servlet instead of Vaadin's default one. This method is called once the servlet is brought up by the container.

houman001