If you web contaniner runs on JDK 1.4 then you can implement TimerTask and use Timer to schedule the TimerTask to run at specific time. Though you can't be sure if the task will run exactly at the specified time (there might be small delay). You can look at the Timer API for info.
Originally posted by Jignesh Gohel: No no not that way joe. Its a requirement in my web application.I have to generate a file using Java & that also at a particular time as previously i mentioned.So using the Java API how can i do it???
I would do it Joe's way. Its the only reliable way. Create a seperate standalone java program. or just get cron to send a signal to your java program at a certain time with a script. Then your program can respond to that. I wouldn't want to create another task scheduling facility where there is already a tried and true one.