0

Hi Experts,

I have written a Servlet file which sends email to a user .When if i run that servlet file in command Prompts it sends a email .Now i want that servlet file to be automatically executed inside my Tomcat server within a stipulated Time . Sothat it can send automatic reminder emails .How is it Possible..pls Help me . I have tried a lots but still i can't make it out. I also add listener in my web.xml file then also i can't get my requirements.....Pls help me out

Thanx in Advance

2
Contributors
3
Replies
4
Views
10 Years
Discussion Span
Last Post by jwenting
0

it's easy. Start a Timer inside the servlet init method, set the servlet to load on web application startup, and away you go.

0

it's easy. Start a Timer inside the servlet init method, set the servlet to load on web application startup, and away you go.

Yes i can start a timer inside the servlet init Method but how to set the servlet sothat it will startup automatically in my web application. Do i use listener in web.xml or any other way are there so that my servlet will automatically load on web application

0

check the servlet specification. There's a simple flag you can set on a servlet declaration in the web.xml that causes the container to load the servlet during application startup.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.