| Author |
Need help
|
Johnson K Jose
Ranch Hand
Joined: Jul 07, 2002
Posts: 36
|
|
Hi all I am getting the following error while running the servlet in the url http://localhost:8080/servlet/HelloServlet I am using Tomcat 4.1.24 HTTP Status 404 - /servlet/HelloServlet type Status report message /servlet/HelloServlet description The requested resource (/servlet/HelloServlet) is not available. Apache Tomcat/4.1.24 ----------------------------- HelloServlet.java ============= import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class HelloServlet extends HttpServlet { public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); String docType = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " + "Transitional//EN\">\n"; out.println(docType + "<HTML>\n" + "<HEAD><TITLE>Hello</TITLE></HEAD>\n" + "<BODY BGCOLOR=\"#FDF5E6\">\n" + "<H1>Hello</H1>\n" + "</BODY></HTML>"); } } I have put the HelloServlet.class file inside Tomcat 4 F:\Program Files\Apache Group\Tomcat 4.1\webapps\ROOT\WEB-INF\classes directory Please guide me where am I going wrong. Thanks in advance Regards Johnson
|
 |
John Hembree
hired gun
Ranch Hand
Joined: Mar 07, 2003
Posts: 250
|
|
I had the same problem and was able to resolve it by uncommenting the following section in the web.xml file in the conf directory of your Tomcat installation. I am using the same version: 4.1.24 This is talked about at this website Configure Tomcat. Look at step 3 "Enable the Invoker Servlet".
|
 |
Johnson K Jose
Ranch Hand
Joined: Jul 07, 2002
Posts: 36
|
|
Hi John thanks for the mail. I have uncommanded the same, still it is not working. now i just copied the file HelloServlet.class in to the followng dir. F:\Program Files\Apache Group\Tomcat 4.1\webapps\examples\WEB-INF\classes and tried the url http://localhost:8080/examples/servlet/HelloServlet it is working? still I don't know what is happening. can any one please give me some light Thanks in advance Regards Johnson
|
 |
 |
|
|
subject: Need help
|
|
|