Hello Ranchers, I have encountered some issues while playing around with servlet mappings. I am trying to map simple requests to the HelloWorldExample servlet that came with Tomcat. It does not seem to work (404 errors). Both application and error Logs are empty. my web.xml:
The web.xml mapping to HI does not work because the HelloWorldExample class is not in a defined package. The JVM tries to look in the "current" directory for classes in the default package - and the current directory is somewhere else. You would have to 1. change the code to use a package and recompile, 2. include the name of the package in the <servlet-class> tag, 3. place the compiled class file under WEB-INF/classes using the package name
Joined: Jul 13, 2004
Thank you for your response. I have tried it and am still having problems. Here is the modified HelloWorldExample code:
I get no errors in any of the logs. I get errors if I put something there that should give an error (like using something other than the name specified in <servlet> in mappings) I have tried placing the HelloWorldEXample servlet into WEB-INF\classes\test\ and straight into WEB-INF\classes\ Error 404 every time. I was able to call /servlet/test.HelloWorldExample okay, so the invoker works and the class is in the package....