app startup code?

Hi , as i read on vaadin , “void init” and constructor called on every request.

I need to run some code just once app server starts.
Vaadin doesnt have that support ?

Hi,

If I understood you correctly, it is doable with ServletContextListener.


public class TestContextListener implements ServletContextListener{

  @Override
  public void contextDestroyed(ServletContextEvent arg0) {
    // NOP
  }

  @Override
  public void contextInitialized(ServletContextEvent arg0) {
    System.out.println("Here!");
  }

}

and in web.xml :


     <listener>
		<listener-class>org.test.TestContextListener</listener-class>
    </listener>

Best Regards,
Alexander.