hi i am new to servlet. i am learning myself using headfirst jsp and servet. i have read the first chapter in that book. and i tried the example given in that first chapter. i followed the steps like in that book . while running the servlet i am getting error like HTTP Status 404 - /Ch1/Serv1 type Status report message /Ch1/Serv1
description The requested resource (/Ch1/Serv1) is not available.
1. i have created directory structure Project1 which has src,classes,etc as sub directory. 2. src has source file 3.etc has web.xml 4.i have build another directory structure under tomcat tomcat->webapps->Ch1->WEB-INF->classes 5.web-inf has a web.xml and the folder classes, which has class file of the source 6.i started the web server while running its showing error
can you please any one do the needful. and tell me if any alternative method is there
It is the fully-qualified class name of the servlet
Moreover, you are advised to put your servlets (like anything else) in packages. Don't put them directly under WEB-INF/classes, or you may get strange behaviours. Make some packages. Like "WEB-INF/classes/servlets"
Originally posted by Jothi Shankar Kumar Sankararaj: Satou,
Why is that we get Strange behaviors when we don't put our servlets in packages??
Strange because you can get away with it for some types of objects but not others. There are specific reasons for this (explained here) but it's much simpler just to package everything than it is to understand all the reasoning that goes behind it.