1 Reply Latest reply: Feb 2, 2010 12:26 PM by 807574 RSS

    problem with web.xml

    807574
      i have the following web application structure where jhtp6 is the context root.
      jhtp6
                 servlets (directory)
                              WelcomeServlet.html (file)
                 WEB-INF (directory)
                              web.xml (file)
                              classes (directory)
                                           WelcomeServlet.class (file)
      I have the following web.xml file content
      <?xml version="1.0" encoding="ISO-8859-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">
      
           <!-- General description of your Web application -->
           <display-name>
                Java How to Program JSP
                and Servlet Chapter Examples
           </display-name>
      
           <description>
                This is the Web application in which we
                demonstrate our JSP and Servlet examples.
           </description>
      
           <!-- Servlet definitions -->
           <servlet>
                <servlet-name>welcome1</servlet-name>
      
                <description>
                     A simple servlet that handles an HTTP get request.
                </description>
      
                <servlet-class>
                     WelcomeServlet
                </servlet-class>
           </servlet>
      
           <!-- Servlet mappings -->
           <servlet-mapping>
                <servlet-name>welcome1</servlet-name>
                <url-pattern>/welcome1</url-pattern>
           </server-mapping>
              
      </web-app>
      where I tried to access the /jhtp6/servlets/WelcomeServlet.html file I get a resource not available error from Tomcat. I tried to remove the web.xml file from the application and the WelcomeServlet.html display fine. I am pretty sure the problem is with my web.xml file. Could anybody take a look and tell me what the problem is? thanks.