tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Seeger <rsee...@hvc.rr.com>
Subject Issues with web.xml
Date Tue, 03 Jun 2003 10:08:56 GMT
I'm having issues with the web.xml file in my webapps/root/web-inf 
directory. What I want to do is be able to specify each individual 
servlet that can be run, by using <servlet> and <servlet-mapping> tags. 
Unfortunately, the best I have been able to do is use a generic servlet 
invoker to allow every servlet to be accessed. When I try to set things 
up so that only one servlet can be accessed, there are errors showing up 
in the dos box when I start Tomcat... which proceed to scroll of the 
screen faster than I can look at them. They do not show up in any of the 
logfiles in the logs directory. I was hoping someone could take a look 
at the web.xml file I'm using and tell me if my error is an obvious one, 
and how to fix it. I tried everything I could think of to make it work, 
and checked all the documentation I could find.

I'm running Tomcat 4.1.24 on Windows 98.

Thank you in advance,
Robert Seeger

---------- Working web.xml, that allows all servlets in the directory to 
be accessed ----------
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

  <display-name>Tomcat Examples</display-name>
  <description>
    Tomcat Example servlets and JSP pages.
  </description>

    <servlet-mapping>
        <servlet-name>invoker</servlet-name>
        <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>

</web-app>
--------------------

---------- Non-working web.xml that causes errors ----------
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

  <display-name>Tomcat Examples</display-name>
  <description>
    Tomcat Example servlets and JSP pages.
  </description>

  <servlet>
    <servlet-name>HelloWorld</servlet-name>
    <servlet-class>HelloWorld</servlet-class>
    <description>
      My test servlet
    </description>
  </servlet>

  <servlet-mapping>
    <servlet-name>HelloWorld</servlet-name>
    <url-pattern>/HelloWorld</url-pattern>
  </servlet-mapping>

</web-app>
--------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message