开发者

Entry point for java web application

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?

----ed开发者_C百科its----

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜