• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how Scheduling Jobs in a Java Web Application

 
hassan ali
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at the java.util.Timer and TimerTask classes. They can be used to schedule recurring events.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
dennis zined
Ranch Hand
Posts: 330
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by hassan ali:
...

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



dang! i gotta learn how to do that
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic