Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Starting Servlet automaticaally when tomcat starts?

 
ayyappa karamsetty
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks.


I have a requirement where , i have one table in that columns are phno , name , id. when ever i update the table one servlet need to read that table and gather phno's continuously with out giving any request to that servlet. Then we can get phno's which are new ones
and send sms to those only.

any one have idea on this send sms. i am using spring's ,tomcat .
is there any other way to do this.
 
Joe Harry
Ranch Hand
Posts: 10122
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your title and your post content seem to contradict.

An idea for your title: Have a look at load on start up element of the web.xml

An idea for your post content: Since you are using Spring, have a look at Spring's timer feature
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at load on start up element of the web.xml

No, don't do that. load-on-startup is an obsolete hack, and should not be used any more. Servlets are for request processing - no request, no servlet.

Web app initialization is done by servlet context listeners these days.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic