I am building a
Vaadin7 application which, among other things, loads a XML file which is the same for all the users.
If i load this file from the init() method, then if 1000 users open a session, the file will be loaded 1000 times, isn’t it ?
How to load the file one time rather than 1000 times ???
For web app initialization, you should consider the web standard method for initializing it via a ServletContextListener as it’s invoked once when your webapp is started via public void contextInitialized(ServletContextEvent sce), and once on shutdown via public void contextDestroyed(ServletContextEvent sce).