Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 68121 invoked from network); 15 Jan 2003 15:58:23 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 15 Jan 2003 15:58:23 -0000 Received: (qmail 4241 invoked by uid 97); 15 Jan 2003 15:57:23 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 4145 invoked by uid 97); 15 Jan 2003 15:57:21 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 4103 invoked by uid 98); 15 Jan 2003 15:57:21 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Message-ID: <1356E12644DED411B83500508BAF58B5CB8C7F@cassmuexc001.cassiopeia.com> From: "Stratmann, Holger" To: 'Tomcat Users List' Cc: "'andy.eastham@gliant.com'" Subject: AW: Servlet Mapping Bug? Date: Wed, 15 Jan 2003 16:55:45 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N > > ie put the full URI in the url-pattern, not just the path=20 > relative to the > > Tomcat application root. Have you configured the "Tomcat application root"? I don't mean in Apache, I mean in server.xml? For each context you configure, you can also specify the "URL-prefix". default: -----Urspr=FCngliche Nachricht----- > Von: Andy Eastham [mailto:andy.eastham@gliant.com] > Gesendet: Mittwoch, 15. Januar 2003 16:17 > An: Tomcat Users List > Betreff: RE: Servlet Mapping Bug? >=20 >=20 > This is a bug, as I've now checked the Servlet Specification v2.3: >=20 > The key phrase is: > The path used for mapping to a servlet is the request URL=20 > from the request > object minus the context path. > ie for my /control/plots/x.jpg request, the context path is=20 > /control, so > only /plots/x.jpg should be used to map the servlet. >=20 > I guess this bug is probably in the Coyote Connector? >=20 > Andy >=20 > PS > Here's the full text of the relevant bit from the servlet spec: >=20 > SRV.11.1 Use of URL Paths > Upon receipt of a client request, the web container determines the = web > application to which to forward it. The web application=20 > selected must have > the longest context path that matches the start of the request URL. >=20 > The matched part of the URL is the context path when mapping=20 > to servlets. > The web container next must locate the servlet to process the=20 > request using > the path mapping procedure described below: > The path used for mapping to a servlet is the request URL=20 > from the request > object minus the context path. The URL path mapping rules=20 > below are used in > order. The first successful match is used with no further=20 > matches attempted: >=20 > 1. The container will try to find an exact match of the path=20 > of the request > to the path of the servlet. A successful match selects the servlet. >=20 > 2. The container will recursively try to match the longest=20 > path-prefix: This > is done by stepping down the path tree a directory at a time,=20 > using the '/' > character as a path separator. The longest match determines=20 > the servlet > selected. >=20 > 3. If the last segment in the URL path contains an extension=20 > (e.g. .jsp), > the servlet > container will try to match a servlet that handles requests for the > extension. > An extension is defined as the part of the last segment after=20 > the last '.' > character. >=20 > 4. If neither of the previous three rules result in a servlet=20 > match, the > container will > attempt to serve content appropriate for the resource requested. If a > "default" > servlet is defined for the application, it will be used. > The container must use case-sensitive string comparisons for = matching. >=20 > Note 1. Previous versions of this specification made use of=20 > these mapping > techniques a suggestion rather than a requirement, allowing servlet > containers to each have their different schemes for mapping=20 > client requests > to servlets. >=20 > > -----Original Message----- > > From: Andy Eastham [mailto:andy.eastham@gliant.com] > > Sent: 14 January 2003 22:46 > > To: Tomcat Users List > > Subject: Servlet Mapping Bug? > > > > > > Hi, > > > > I've just upgraded from Tomcat 4.0.4b1 and apache 1.3 using=20 > warp to Tomcat > > 4.1.18 and Apache 2.0.43 using mod_jk2. > > > > I use a feature of servlet mapping in web.xml, where I map any > > request under > > a particular directory to a single servlet. My application=20 > is mapped from > > Apache under the url "/control/" and I invoke myServlet with any > > request to > > the "plots" subdirectory. In the old configuration, the relevant > > part of my > > web.xml looked like: > > > > > > > > myServlet > > > > > > /plots/* > > > > > > > > However, in my new setup, I have had to change this to make it = work: > > > > > > > > myServlet > > > > > > /control/plots/* > > > > > > > > ie put the full URI in the url-pattern, not just the path=20 > relative to the > > Tomcat application root. > > > > This strikes me as less portable - if I change my url=20 > mapping from Apache, > > I'll have to edit my web.xml, which wouldn't have been necessary > > before. Is > > this a bug, or has it really been changed to better comply with > > the Servlet > > spec? > > > > Best regards, > > > > Andy Eastham > > > > > > > > -- > > To unsubscribe, e-mail: > > > > For additional commands, e-mail: > > > > > > >=20 >=20 >=20 > -- > To unsubscribe, e-mail: =20 > > For additional commands, e-mail:=20 > >=20 -- To unsubscribe, e-mail: For additional commands, e-mail: