• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how Scheduling Jobs in a Java Web Application

 
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have a look at the java.util.Timer and TimerTask classes. They can be used to schedule recurring events.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 330
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic