aspose file tools*
The moose likes Tomcat and the fly likes How to start some funcionality of web app after deploying on Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to start some funcionality of web app after deploying on Tomcat" Watch "How to start some funcionality of web app after deploying on Tomcat" New topic
Author

How to start some funcionality of web app after deploying on Tomcat

Petr Hnilica
Greenhorn

Joined: Jan 13, 2010
Posts: 4
Hi

I want to start "emailer" after deploying on tomcat. Emailer should check in database terms of task and sends email if deadline is coming (it is school semestral app). But i dont know how to start up timer (emailer class) after deploying. I have read many of tomcat documentation and googled it.

I know how to do it seperetly. Emailer can be start up like a standard java app. And maybe it is smarter solution. But i want to know if it is possible.

Im using j shedluer like a timer

Thanks

PS: just link or typing "stupid idea" is welcomed
Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
How about http://www.quartz-scheduler.org/ ?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10376
    
    8

Welcome to the Ranch.

Check out ServletContextListener
contextInitialized is invoked by the container, when your app is deployed. You can trigger off your scheduling tasks in that method.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Petr Hnilica
Greenhorn

Joined: Jan 13, 2010
Posts: 4
Thank you for answering. I thought that is easy. But sometimes i think something can be done easily, but that is not it.
Petr Hnilica
Greenhorn

Joined: Jan 13, 2010
Posts: 4
So this article help me make it.

listener
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to start some funcionality of web app after deploying on Tomcat