This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am having some trouble using the init method. In my web.xml file I am setting load-on-startup to 1. So when I startup my servlet engine my servlet with the load-on-startup paramter will start up. This is working just fine. The init method gets called and starts executing the code in the body. However, I am calling another method of another class that simply prints out a message to the screen. This method does not seem to be getting called. It's like it just jumps right over the method call and continues to load the servlet engine. below is my code example that I'm executing.
Hi 1 is getting executing, but when calling the TemperatureTimer constructor, Hi 2 is not getting called. Why is this? I can't figure this out if my life depended on it. I want to write a Servlet that gets instantiated automatically when the servlet engine starts. The TemperatureTimer does implement Runnable. I'm reading temperatures via iButtons, but can't seem to instantiate the darn TemperatureTimer class. I even had the TemperatureTimer class methods inside the servlet class. Still no methods were getting called. I'm sure it's something easy that I'm just overlooking. Thanks in advance for you time, Ryan
SCJP 1.4, SCWCD
Java: The power, elegance, and simplicity of a hand grenade