HI I want to run a simple program on servlet and the application is a simple program Hello world to print on Internet browser. And the directory for servlet is like this Apache Software Foundation/Tomcat 5.0/webapps/ i created myapps folder and in that folder i created WEB-INF folder and in that i created classes and lib and web.xml folders. Now i compiled Helloworld program in myapps directory and it is ok Next in web-xml i set class-name and URL-pattern as followes in class-name i put the Servlet class name(Which i put as ServletDemo) and in URL pattern i typed myapps/ServletDemo. Next i cut the java.class and pasted in classes folder. Next i created Servlet.html file and in that html file i typed like this(< form action="http://localhost:8080/myapps/ServletDmeo" method="Get"> Next step deployed war file under the myapps directory Now i started Tomcat . Next i opened Browser and i typed Tomcat Manager and i got /myaps directory now i clicked on /myapps and got html file,java,file and war file . next i clicked on html and i got html page now i clicked on Submit button and the browser is showing an error like 404 the path servletDemo is not there SO kindly tell me why it so happened and rectify the problem to get the correct solution.
Put your ServletDemo.java class into classes folder and then compile it. After compiling restart the tomcat server.And then run the html file.
For more information, go through the following links: