954,574 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Auto call to a servlet file inside Tomcat 4.1

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

jeet_portal
Newbie Poster
18 posts since Jan 2007
Reputation Points: 10
Solved Threads: 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.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 
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

jeet_portal
Newbie Poster
18 posts since Jan 2007
Reputation Points: 10
Solved Threads: 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.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You