Why can't run Sevlet in Tomcat5

Edward King <[email protected]>
Newsgroups gmane.comp.java.sun.servlet
Message-ID <006e01c37e83$edf1d3d0$922aa8c0@sky>
I have a servlet file,like follows:

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class a1 extends HttpServlet{
    public void doGet(HttpServletResponse req,HttpServletResponse resp) throws ServletException,IOException{
        PrintWriter pw=resp.getWriter();
        pw.println("<html><body>Hello World!</body></html>");
        pw.close();
    }
}

and web.xml is follows:
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
   <servlet>
   <servlet-name>a1</servlet-name>
   <servlet-class>a1</servlet-class>
   </servlet>
</web-app>

I use Tomcat5.0,I don't want to use Tomcat5 default path ,so I put a1.class into \Tomcat 5.0\webapps\test\WEB-INF\classes,and I have added a sentence into server.xml,like follows:

<Context path="test" docBase="test" debug="0"/>

but when I run it in IE6,like follows:
http://localhost:8080/test/servlets/a1

it raises HTTP Status 404 error,"The requested resource (/test/servlets/a1) is not available."

Why? I have configure path! Please help.
Thanks in advance
Edward

___________________________________________________________________________
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.