tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Fox" <da...@smarttalk.com>
Subject 2 WEB.XML questions
Date Wed, 19 Jul 2000 18:59:08 GMT
Running Tomcat v3.2b2, NT4sp6

I have an observation and a two questions regarding web.xml/web.dtd.  I am
using the following web.xml and everything is working correctly.  Notice
however that I didn't follow the dtd when I put a 2nd <url-pattern> mapping
in my servlet mapping. I would like some feedback on why this works and
whether this might be something worthly of be officially added to the dtd.

My second question: why do I have to put '/servlet/' in front of the servlet
name in my secondary mappings.  (I have to do this even if I follow the dtd
and put every <url-mapping> in it's own <servlet-mapping>.)  If I remove
'/serlvet' Tomcat can't find the servlet.  ????

Dave

my web.xml:
###################################################
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">

<web-app>
<!-- LoginServlet -->
    <servlet>
        <servlet-name>LoginServlet</servlet-name>
        <servlet-class>tesla.ui.LoginServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>LoginServlet</servlet-name>
        <url-pattern>/LoginServlet</url-pattern>
		<!-- 2nd mapping -->
        <url-pattern>/servlet/Home</url-pattern>
    </servlet-mapping>

<!-- ClientListServlet -->
    <servlet>
        <servlet-name>ClientListServlet</servlet-name>
        <servlet-class>tesla.ui.ClientListServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>ClientListServlet</servlet-name>
        <url-pattern>/ClientListServlet</url-pattern>
		<!-- 2nd mapping -->
        <url-pattern>/servlet/ClientList</url-pattern>
    </servlet-mapping>
 </web-app>
####################################################


Mime
View raw message