hi all, iam trying to learn jsp using Tomcat. iam using the book head first servlets & jsp! i have been following the instructions in the book on creating packages/folders and placing them as follows:
html files: tomcat\webapps\Beer-v1\form.html servlet class files: tomcat\webapps\Beer-v1\WEB_INF\classes\com\example\web\BeerSelect.class when i tried to run the html file i got the error "404 the requested resource /Beer-v1/form.html" does not exist. i did some search on the internet and found that the html files need to be placed in the ROOT directry under webapps. i did that and the html file worked. next i tried to invoke the servlet but the error "requested resource /BeerSelect.do does not exist. i chkd the internet again and iam getting so many conflicting answers on where the classes files should be placed! has anyone placed similar problems? and where should i place all the files? thanks!
This could be just a typo on your part, but the directory is named "WEB-INF", not "WEB_INF". Inside WEB-INF you need a web.xml file where your servlets are mapped. Lastly, "BeerSelect.do" seems to indicate that you're using Struts, which is probably much more advanced than where you're at right now (unless BeerSelect.do is mapped to the BeerSelect.class which is a servlet; but that would need to be declared in web.xml).