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 installed Tomcat 6.xxx on Windows XP. I understand Tomcat 6.0\webapps\ROOT is the default webapps directory. Other subdirectories in webapps directory are docs, host-manager and manager. ROOT has WEB-INF subdirectory and couple of .GIF, .xml, .html, .jsp etc files. I put couple of testjsp and html files and they worked fine. I, however, am unable to understand where to place a compiled servlet file and test. Initially I placed directly in ROOT along with jsp, html files but it didn't work. I then created a classes subdirectory in WEB-INF and placed the compiled servet in classes subdirectory of WEB-INF. Still didn't work. I modified the default web.xml file that is available in WEB-INF directory by adding <servlet> and <servlet-mapping> tags for the compiled servlet. Still no use. Does anyone know what exactly needs to be done to make the example servlet work?
I assumed webapps\ROOT is the default web application directory because there are couple of jsp, GIF files etc. I placed my own example HTML and jsp files in webapps\ROOT and they worked fine. I am trying to figure out how to make an example servlet work. webapps\ROOT\WEB-INF directory doesn't contain classes subdirectory. It has a web.xml file. To the web.xml file, I added <servlet> and <servlet-mapping> tags for the example servlet and then created a classes subdirectory in webapps\ROOT\WEB-INF and placed the example servlet class file in webapps\ROOT\WEB-INF\classes directory. I restarted Tomcat and tested the example servlet from the browser using the url:. web.xml entry is: Wondering where I'm going wrong