This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
hi, I installed Tomcat and Apache under win 95, set up the classpath as required. sample programs in dir \webappls\examples\servlets\ run OK. I compile my HTTPGetServlet.java and put the class file in \examples\Web-inf\classes\, the .html in \examples\servlets\ The .html file as follows: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <!-- HTTPGETServlet.html --> <HEAD> <TITLE>Servlet HTTP GET Example</TITLE> </HEAD> <BODY> <FORM ACTION = "http://127.0.0.1:8080/examples/Web-inf/classes/HTTPGetServlet" METHOD = "GET"> <P>Click the button to have the servlet send an HTML document</P> <INPUT TYPE = "submit" VALUE = "Get HTML document"> </FORM> </BODY> </HTML> Please help, Thanx, Simon
Joined: Aug 16, 2000
sorry, i forgot to point out the problem. the error given when i press the Button "Get HTTP document": Not Found (404) Original request: /examples/Web-inf/classes/HTTPGetServlet Not found request: /examples/Web-inf/classes/HTTPGetServlet Thanx, Simon
"http://127.0.0.1:8080/examples/Web-inf/classes/HTTPGetServlet" Is not the correct way to address the servlet. In fact, web servers are forbidden to directly serve any file from the WEB-INF directory. Instead, the server applies various rules to the raw URL to determine exactly what needs to be done. "http://127.0.0.1:8080/examples/servlet/HTTPGetServlet" should do the trick. Take a look at the example servlets and JSP provided with Tomcat to see how they are addressed. Study the web.xml file in the webapps/examples/WEB-INF directory. Bill