Hi All,
I gone thru other
thread about the same error on the forum and didn't find any of the suggestion working.
Please help me .....
I am trying to run Head First
Servlet example and from (few other books also)
Detail of plateform:-
OS Windows Vista.
Tomcat 5.5
JRE 1.6
IDE used eclipse and Tomcat is configured in eclipse using •Sysdeo Tomcat Plugin
Directory Structure
C:\Tomcat\Tomcat 5.5
C:\Java\jre
Project Dir
C:\Tomcat\Tomcat 5.5\webapps\ch1
C:\Tomcat\Tomcat 5.5\webapps\ch1\WEB-INF\classes contains Ch1Servlet.class
C:\Tomcat\Tomcat 5.5\webapps\ch1\WEB-INF contains web.xml
Cdoe snippet
Ch1Servlet.java code
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class Ch1Servlet extends HttpServlet
{
public void doGet(HttpServletRequest request1, HttpServletResponse response1)
throws IOException, ServletException
{
PrintWriter out = response1.getWriter();
java.util.Date today = new java.util.Date();
out.println("<html>" + "<body>" + "<h1 align = center> HF first servlet </h1>" + "<br>" +
today + "</body>" + "</html>");
}
}
web.xml
<?xml version=”1.0” encoding=”ISO-8851-1” ?>
<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
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>
</servlet-mapping>
</web-app>
when i try to
http://localhost:8080/ch1/Serv1
type Status report
message /ch1/Serv1
description The requested resource (/ch1/Serv1) is not available.
I think it should run but don't know if i may be missing...
Tomcat setting
VM arguments
-Dcatalina.base="C:\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0" -Dcatalina.home="C:\Tomcat\Tomcat 5.5" -Dwtp.deploy="C:\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps" -
Please let me know if any other detail is needed.
Regards,