My first servlet app is online
Monday, June 19th, 2006In this weblog entry, I talked about how to turn on the invoker servlet in Tomcat 5.0.28. I’ve received some advice since then from members of the Kansas City JUG telling me never to use the invoker servlet. In fact, even the JavaRanch page I referred to in the previous post had a link touting the evils of the invoker servlet. In addition, my KCJUG colleagues have assured me that registering each of my servlets with Tomcat through the web.xml file is simple.
So I did it. And it was easy.
My main beef now is with the text I’m following. All the examples so far in the book just drop the servlets into the default folder and use the invoker servlet to find them. In fact, there is no detailed explanation of web.xml and it’s features until Volume 2 of the book, which hasn’t even been published yet! (Actually, the first edition is published and available for free, but I’m still pissed!) I would think that there would be more about web.xml.
Anyway, I did get a sample application up on my website and coaxed the people at pointless waste of time to test it out. All it does is track clicks on links within a page, but I’m pretty happy with it as a first servlet application. I also got my redirect working so http://www.dangertree.net actually points to the index.php page (by default, Tomcat doesn’t recognize ‘index.php’ as a default page).
