• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

event alert

 
Ranch Hand
Posts: 156
Hibernate Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
we have a got small problem in tomcat
if any application has to be run continuosly run in the server then the application should be plcaed in which directory/path of tomcat.Here the application is simple java program.
for example:
I have an application which sends the birthday wishes mail to the users
The users are registred with me . So i will write a java program such that
it will automatically send the mail to the user by comparing the present date and their birthday
This application should be continously(24/7) run in server and whenver it finds date matches it should execute that java file
I wrote the java program but where we should place this java file in the server path .Im using tomcat 4.0
any body please help
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Exactly what is the connection between Tomcat and this birthday server anyway? If you wrote it as an application with a main() method, it can run anywhere. If you just want to have it running in the Tomcat JVM, you will have to give it a servlet wrapper, a web.xml entry, and treat it like a servlet that gets loaded on startup.
If this was my problem I would have the servlet wrapper capable of reporting statistics from the birthday server - makes it easy to check up on it.
Bill
 
santhoshkumar samala
Ranch Hand
Posts: 156
Hibernate Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks mrBrogden,
my birthday server is nothing but this tomcat,
can you please provide sample code for writing this servlet and place in web.xml
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

can you please provide sample code for writing this servlet and place in web.xml


No - I charge $ for this sort of thing.
I am sure you can do it yourself if you proceed methodically.
Look at the use of the <load-on-startup>1</load-on-startup> element in web.xml to see how to be sure a servlet is always loaded when the server starts. Use the init method of that servlet to create an instance variable of your birthday server. Use the doGet or doPost method of that servlet to report the status of the birthday server.
Bill
 
santhoshkumar samala
Ranch Hand
Posts: 156
Hibernate Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank u william for your answer
I got the tag but can u give the code of sample servelet and where should the class file of the servlet placed?
 
Seriously? That's what you're going with? I prefer this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic