aspose file tools*
The moose likes Tomcat and the fly likes 404 Error - Can't access Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "404 Error - Can Watch "404 Error - Can New topic
Author

404 Error - Can't access Servlet

Brendon Lippy
Greenhorn

Joined: Jun 01, 2003
Posts: 1
Hello,
I'm trying to build a basic servlet using Apache Tomcat 5.0. I made a simple servlet:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Test extends HttpServlet
{
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException,IOException
{
PrintWriter out = response.getWriter();
out.println("Hello World!..");
} /* doGet */
} /* Test */

I compiled this class, and put the .class file into the ROOT/WEB-INF/classes. I tried to access this servlet through a browser using the following URL: http://localhost:8080/servlet/Test
I get the 404 error (cannot access resource). What am I doing wrong?
-Brendon


Lets Face it.. Not all of us are Java Gurus
Jason Brawner
Ranch Hand

Joined: Dec 19, 2001
Posts: 66
Did you add the servlet to your deployment descriptor (web.xml)?


Jason E. Brawner<br />Sun Certified Java Programmer<br />Sun Certified Web Component Developer
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: 404 Error - Can't access Servlet