i am preparing for scwcd.I was trying the first servlet example.I made a java file Ch1Servlet.java and DD web.xml.I performed all the steps written in the book.
project1 and tomcat both are in d directory.I compiled the program using command
javac \apache-tomcat-5.5.33\tomcat\common\lib\servlet-api.jar -d classes src/Ch1Servlet.java.then i copied the class file to web-inf/classes and xml file to web-inf.
i did everything perfectly but when i type http://localhost:8080/ch1/Serv1 Http status 404 error is coming.it says requested resource is not available.
Tomcat is running perfectly.when i point my browser to localhost:8080 home page of apahce is coming.
what could be the probelm?It is getting very frustrating.please help me.
BIG BIG Thanks in advance
As i said i compiled the java file and put the .class file in project/classes
Then i copied web.xml in web-inf and .class file in classes.
Tomcat is running perfectly but when i type localhost:8080/ch1/Serv1 it says
Http Status 404
type status report
description The requested resource () is not available.
Apache tomcat /5.5.33
Early editions of Tomcat had a servlet called the Invoker servlet which gave limited execution capabilities to servlets not in packages. I suppose the idea was to make it easy for beginners to execute a first servlet.
This idea turned out to be a disaster which has caused endless trouble ever since. Just accept the annoyance of learning how to use web.xml and packages - you will be glad you did.