Well in web.xm
l i have added the listener and in its contextInitialized I have written :
JobDetail jd = new JobDetail("myjob", Scheduler.DEFAULT_GROUP, Myclasstobe triggered.class); CronTrigger tr = new CronTrigger("myCronTrigger", Scheduler.DEFAULT_GROUP, "0 00 12 ? * MON-FRI");
scheduler.scheduleJob(jd, tr);
and in Myclasstobetriggered
I have overridden the execute method where my task is written to be done.