Hi,

I installed CentOS 6.5 and include both java devel and Tomcat packages during the installation. Trying to test that tomcat is working, I compiled the following:

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Test extends HttpServlet{

public void doGe(HttpServletRequest request, HttpServletResponse response)
throws IOException{
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<body>");
out.println("<h1>Hello Servlet Get</h1>");
out.println("</body>");
out.println("</html>");
}
}

and moved the .class under /var/lib/tomcat6/webapps/ROOT/WEB-INF/classes

I save the following web.xml under /var/lib/tomcat6/webapps/ROOT/WEB-INF

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" 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
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

<servlet>
<servlet-name>Servlet Name For Demo1</servlet-name>
<servlet-class>Test</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>Servlet Name For Demo1</servlet-name>
<url-pattern>/Demo1</url-pattern>
</servlet-mapping>
</web-app>

I then started both httpd and tomcat6, started firefox and typed 127.0.0.1:8080 and got:

HTTP Status 404-/
type status report
message /
description The requested resource (/) is not available
Apache Tomcat/6.0.24

When I tried 127.0.0.1:8080/Test, I got:

HTTP Status 404-/Test
type status report
message /Test
description The requested resource (/Test) is not available
Apache Tomcat/6.0.24

I'm starting to learn servlets and would appreciate your help!