I am developing a java web-site. It fetches data from http://projects.zoho.com.
I have to fetch data using its API and want to fill database in a session.
But, I need this process occur at deploy time. Means, at first time when I deploy web, it would fill whole database and then at every session period of time it fills data automatically.
What step I should follow ?
Write a ServletContextListener which populates the database and does the work in the contextInitialized() method.
If the listener is configured in your web.xml, the servlet container will invoke your listener’s contextInitialized() method when the webapp is started.