开发者

Vaadin Entry Point

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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜