Entry point for java web application – Education Career Blog

I need to know where i can start a cron in my java web app. I need this cron to run daily and be rescheduled if the server restarts. Do java web application have hook where i can do this?


Im using quartz to schedule a task which will pull down and parse a csv file and store it in a database. I need to know where i should schedule it to run the first time


You might want to use a ServletContextListener. It supports two methods that run when an web app is started and ended. This article goes over setting one up. You can start the Quartz scheduler in the Initialize method and shut it down in the Destroy method.

Leave a Comment