This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I get 404 not found error - that's why put the files where I knew the example files were - to make sure Tomcat was functioning - appears so.
Tried searching on this, have been unable to find it. (Yes I know link to Tomcat documentation, but have not been able to find it there either - main page of docs has links to JSP...didn't see to servlets)
At the top of your classes, include the line: package test;
Then put your classes in a directory named "test" and put that directory in your classes directory.
Make sure the path to your "test" directory is on the classpath before compiling.
Joined: Mar 03, 2005
just wanted to state for any future searches for others w/same problem...
what I did was take his "simpleservlet" package, and replaced all the simples with hellos...making sure to maintain case sensitivity
additionally, when compiling HelloServlet, just had the package name as "package us;" instead of something long for this quick check.
Sure enough, it worked, and this is with ALL server.xml settings back to default as advised
So, I have no clue why it will work in examples dir, but not here....but really....it's okay, because I just gained (and hopefully future readers) extra knowledge to take packaging skills to the next level above extremely basic.
When a servlet works in the examples "web application" directory but nowhere else, it is typically because the examples web.xml contains a mapping for the invoker servlet. For example, this one from Tomcat 4.1.30