public class beerselect extends HttpServlet
public void doPost(HttpServletRequest request,HttpServletResponse response) throws IOException, ServletException
out.println("<br>got beer color "+c);
This all is the hierarchy where i have put up my files.
Now i have started apache tomcat 5.5 and wrote in the browser
http://localhost:8080/form.html then my form APPEARS.
when i select an option and click on button, I get an error:
HTTP Status 404 - /beer/selectbeer.do
type: Status report
description: The requested resource (/beer/selectbeer.do) is not available.
Now, I engaged all my mind in resolving the error, but can't sort out that.
So, I request you to have a look and sort out my problem..
If you're deploying to the ROOT context then your classes should be in ROOT/WEB-INF/classes. Right now it looks like you couldn't decide if you wanted to deploy to root or to beer, so sort of did both. But it won't work like that :)
the issue is resolved.
Simply i put my beer folder in webapps, and it worked.
but one thing , i am not able to understand..that earlier when my beer folder was in folder webapps/root/, then i was typing in the browser:
and this time when i put my beer folder in webapps, then also i am typing the same thing
webapps is the deploy folder of tomcat, which means, http://localhost:8080/beer/form.html will search for beer inside webapps, and then locate the form.html inisde beer.. if you put your beer inside Root, beer will not be an deployable project...
In Tomcat, ROOT is mapped to /, so in the above URL, /beer/form.html will be searching for beer inside ROOT and form.html inside beer, which is there so, it will present you the html. As, I told you, since it is not a deployable project, server will not register the servlets written by you inside that folder, so you get resource not found exception...