Originally posted by Ben Souther:
No,
Post your web.xml file.
Also tell us where your files are.
Specifically the servlet class file but also any other files in the application.
This is my xml file:
<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_2.4.xsd" version="2.4">
<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>
</sevlet-mapping>
</web-app>
The servlet is:
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class Ch1Servlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException
{
PrintWriter out=response.getWriter();
java.util.Date today=new java.util.Date();
out.println("<html>" + "<body>" + "<h1 align=center>HF\'s Chapter1
Servlet</h1>"+"<br>"+today+"</body>"+"</html>");
}
}
There are only two files in the tomcat directory:
Ch1Servlet.class is in:
c:\tomcat\jakarta-tomcat-5.5.7\webapps\ch1\WEB-INF\classes
web.xml is in:
c:\tomcat\jakarta-tomcat-5.5.7\webapps\ch1\WEB-INF