Hi all,
I m unable to run
servlet..
it gives the following error
The requested resource (Servlet Chapter1 Servlet is not available) is not available.
ch1servlet.class is the class file which is stored on F:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\ch1\WEB-INF\Classes\com\examples
web.xml is strored on F:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\ch1\WEB-INF
The ch1servlet source file is as follow as
package com.examples;
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>Chapter1 Servlet </h1>"+ "<br>"+today+"</body>"+"</html>");
}
}
web.xml file is as follow as
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<display-name>Welcome to
Tomcat</display-name>
<description>
Welcome to Tomcat
</description>
<!-- JSPC servlet mappings start -->
<servlet>
<servlet-name>Chapter1 Servlet</servlet-name>
<servlet-class>com.examples.ch1servlet</servlet-class>
</servlet>
<servlet-mapping>
<url-pattern>/Serv1</url-pattern>
<servlet-name>Chapter1 Servlet</servlet-name>
</servlet-mapping>
<!-- JSPC servlet mappings end -->
</web-app>
really cant figure out what is the problem
please help