tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "kevin hwang" <khwang1...@msn.com>
Subject what is location of servlet class in the TomCat /404 error
Date Sat, 08 Dec 2001 05:38:07 GMT
Hi:

I'm trying to bring up "hello world" using TomCat.

My Hello.jsp is working when I type
http://localhost:8080/servlets/Hello.jsp
but
when I am typing http://localhost:8080/servlets/Hello
on my browser I got:

Apache Tomcat/4.0.1 - HTTP Status 404 -
/servlets/Hello

type Status report
message /servlets/Hello
description The request resource (/servlets/Hello) is not available

Here is the source code:

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

class Hello extends HttpServlet
{
    public void service(HttpServletRequest  req,
                        HttpServletResponse res)
        throws ServletException, IOException
    {
        res.setContentType("text/html");
        PrintWriter out = res.getWriter();      

        out.println("<HTML>");
        out.println("<HEAD><TITLE>Hello World</TITLE></HEAD>");
        out.println("<BODY>");
        out.println("Hello World ");
        out.println("</BODY></HTML>");

    }   // end of service

}   // end of Hello class


Please help. Thanks.

- Kevin Hwang
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message