This week's book giveaways are in the AI and JavaScript forums.
We're giving away four copies each of GANs in Action and WebAssembly in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

web.xml autorun

 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone know how to have tomcat auto start a servlet once the tomcat service is started.
I found that if I include
<load-on-startup>1</load-on-startup>
for my servlet in my xml that would work. But I have also read that this can cause complications.
Ok here is my web.xml file

I was told the lower the number takes precedence in <load-on-startup>
My code is as follows

Neither one of my sys.out statements are being called.
Any suggestions? I would like to make a timed thread execute once tomcat is started. I am using tomcat 4.1
Thanks in advance for your time,
Ryan
 
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<load-on-startup> work fine by me.
to make servlet be initialized first you should put the value of 1 , not -1.
try it.
 
Ryan Bailey
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Someone please help!!
I have double checked my code and web.xml file and I still do not understand why I am not seeing an output of hello once I start the servlet engine. I thought maybe it was a configuration at work, but I tried testing this case at home and I'm still having the same issue. If anyone could lead me into the right direction it would be very appriciated.
Thank you,
Ryan
 
Ryan Bailey
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, NEVERMIND!!
I figured it out. Who ever told me that negative numbers took precedence over positive number it full of you know what. I changed my negative number to a positive number and it worked just fine. Sorry for sounding so desperate but I was really starting to not understand why this wasn't working.
 
Don't listen to Steve. Just read this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!