This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regular mail sending on server application

 
Pavels Hlopoks
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello! I have a problem.

I need once at week automatically send mail in my webapp...
How can I do it? I think I must deploy with my app some.. Some liberally or something like this.

Actually problem is - how to identify event - ONCE AT WEEK?

Thanks!
[ March 07, 2007: Message edited by: Bear Bibeault ]
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The java.util.Timer and TimerTask classes can schedule events that occur in regular intervals (e.g., every 24 hours), or at specific points in time (e.g, every Friday night at midnight). See here for examples e367 and e368.
 
Pavels Hlopoks
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf!
But how can I run something like this example on server?
When start app server must run something like servlet... or something else ,who looking for time
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming you have a web app, you can run code at web app startup time by configuring a ServletContextListener and its contextInitialized method.
 
Pavels Hlopoks
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cheers! Thanks! Good idea
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic