new to
tomcat only used wsad.....plz help me out here
created a
servlet named Ch1Servlet and kept its class file under
C:\Program Files\Apache Group\Tomcat 4.1\webapps\ch1\WEB-INF\classes
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class Ch1Servlet extends HttpServlet{
public void doGet(HttpServletRequest request, HttpServletResponse
response) throws IOException{
response.setContentType("text/html");
PrintWriter out= response.getWriter();
java.util.Date today = new java.util.Date();
out.println("<html><body><h1 align=center>HF Chapter1</h1>"+
"<br>"+today+"</body></html>");
}
}
created an xml file name web.xml in
C:\Program Files\Apache Group\Tomcat 4.1\webapps\ch1\WEB-INF
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee"
web-app_4_1.xsd"
version="4.1.30">
<servlet>
<servlet-name>Chapter1 Servlet</servlet-name>
<servlet-class>Ch1Servlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Chapter1 Servlet</servlet-name>
<url-pattern>/Serv1</url-pattern>
</servlet-mapping>
</web-app>
http://localhost:8080/ch1/Serv1 give the folling error
HTTP Status 404 - /ch1/Serv1
--------------------------------------------------------------------------------
type Status report
message /ch1/Serv1
description The requested resource (/ch1/Serv1) is not available.
--------------------------------------------------------------------------------
Apache Tomcat/4.1.30
its not under any package and used full path for Servlet-class also
but it didnt work