Hi, I have used tomcat 4 before and I cannot imagine that I cannot solve such a small thing. Anyway, I thought I must be missing something.Ok, here is the problem. I installed Tomcat5 under c:/tomcat5 (to make sure I don't mess with dos naming). I wrote a form.html which I placed under c:/tomcat5/webapps/test/form.html. I started tomcat and went to http://localhost:8080/test/form.html. I am getting a 404 error. I placed the same html file under c:/tomcat5/webapps/ROOT/form.html and I can access it from http://localhost:8080/form.html. What am I doing wrong ? I know its a really basic thing but I have wasted over 2 hours of my time and didn't think it was worth it. So, if anybody can help, I would appreciate it! Thanks!
In your test folder under your webapps directory, do you have a WEB-INF directory within your test folder? Tomcat must see a WEB-INF folder inside your application, or else it will not register the application I have found. I recreated your problem my adding a test1 directory to webapps, then placed an html document under test1 called test1.htm. If I don't have an WEB-INF directory under test1, then Tomcat throws the 404 error. Once I add the WEB-INF, then restart Tomcat, everything is fine. Try adding a WEB-INF folder underneath your test folder. Then restart the Tomcat server and try http://localhost:8080/test/form.html again. Make sure you take out the form.html from the ROOT directory, or else you won't know which one is really working. Hopefully this helps.
Joined: Sep 08, 2004
Wow! You are so right ! I did not know that! I put a WEB-INF file and it works! Thank you so much!