Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Tomcat 404 Cannot find error  RSS feed

 
Simon Moose
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi There

I'm just starting to learn servlets and have started to encounter trouble already. Iam following the Head First Servlets and JSP Book.

It is the first example about SelecBeer.

I initially set up the directory structure as follows:

C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\Beer-v1\form.html

form is a simple "post" method with 1 option called color.

No from browser this worked fine.

Beer-v1 is my top folder.

C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\Beer-v1\WEB-INF\classes\com\example\web\BeerSelect.java

Now after compiling this servlet BeerSelect.java in Jcreator i copied the class file and pasted it as the nxt line shows.

C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\Beer-v1\WEB-INF\classes\com\example\web\BeerSelect.class

Now according the book..I have done everything right as far as I can tell.

When i try to access localhost:8080\Beer-v1\form.html I'm getting 404 not found error.

All my other sample files work fine , so i know no problem with tomcat. I have tried restarting tomcat several times , copying, repasting etc. I personally feel after compiling servlet when I;m pasting class file as shown above, Iam missing something.

Please advise as it is driving me crazy!!!

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66204
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Simon Moose", please check your private messages.
 
Bosun Bello
Ranch Hand
Posts: 1512
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure your web.xml is correct. If you are not sure, post it here.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!