aspose file tools*
The moose likes Servlets and the fly likes how Scheduling Jobs in a Java Web Application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "how Scheduling Jobs in a Java Web Application" Watch "how Scheduling Jobs in a Java Web Application" New topic
Author

how Scheduling Jobs in a Java Web Application

hassan ali
Ranch Hand

Joined: Apr 23, 2006
Posts: 127
hi

does any body now how to Scheduling Jobs in a Java Web Application?

i need to send mail every day to manger?

thank, you
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42946
    
  70
Have a look at the java.util.Timer and TimerTask classes. They can be used to schedule recurring events.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

There is nothing in the servlet spec about scheduling jobs.
Some containers have their own mechanisms for doing so.

In addition to the APIs provided by Ulf, there is the Quartz scheduler (which offers more fine grained control thatn the others.

Personally, for something simple and straight forward like this, I call the mailer object from a servlet and use either a unix cron job with wget or a windows scheduler task with a little command line Java app to make a web request to the servlet.

Using the OS to schedule the calls this way eliminates the need for you to spawn and maintain threads from within your web application.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
dennis zined
Ranch Hand

Joined: Mar 07, 2003
Posts: 330
Originally posted by hassan ali:
...

i need to send mail every day to manger? ....



dang! i gotta learn how to do that


SCJP 1.4<br />SCWCD 1.4
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how Scheduling Jobs in a Java Web Application