Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5A51D10AE7 for ; Thu, 7 Nov 2013 21:52:01 +0000 (UTC) Received: (qmail 58000 invoked by uid 500); 7 Nov 2013 21:51:57 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 57950 invoked by uid 500); 7 Nov 2013 21:51:57 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 57941 invoked by uid 99); 7 Nov 2013 21:51:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Nov 2013 21:51:57 +0000 X-ASF-Spam-Status: No, hits=3.4 required=5.0 tests=HTML_MESSAGE,ONE_TIME,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of milo@cyberlifelabs.com designates 76.96.30.17 as permitted sender) Received: from [76.96.30.17] (HELO qmta10.emeryville.ca.mail.comcast.net) (76.96.30.17) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Nov 2013 21:51:50 +0000 Received: from omta21.emeryville.ca.mail.comcast.net ([76.96.30.88]) by qmta10.emeryville.ca.mail.comcast.net with comcast id mjpF1m0051u4NiLAAlrVz8; Thu, 07 Nov 2013 21:51:29 +0000 Received: from [10.0.1.101] ([24.17.64.96]) by omta21.emeryville.ca.mail.comcast.net with comcast id mlpU1m00T24byjc8hlpV0l; Thu, 07 Nov 2013 21:49:29 +0000 From: Milo Hyson Content-Type: multipart/alternative; boundary="Apple-Mail=_ABB7CB24-088B-4738-91D0-35FC36733373" Message-Id: Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: Baked-in context paths Date: Thu, 7 Nov 2013 13:49:24 -0800 References: <7A5B0B8F-BA94-4C2B-9ED7-5D38ED77696A@cyberlifelabs.com> <52793DB3.1070207@christopherschultz.net> <527ABA02.5040103@christopherschultz.net> <527BB84C.4080909@christopherschultz.net> <0C35A015-C0AD-4545-9D04-12F518EA8D89@cyberlifelabs.com> <527C0517.9040302@christopherschultz.net> To: "Tomcat Users List" In-Reply-To: <527C0517.9040302@christopherschultz.net> X-Mailer: Apple Mail (2.1510) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1383861089; bh=k72c4TJXKi2pQpwQ9dcZ76Hy04KQaBifRlbh2uBIT0k=; h=Received:Received:From:Content-Type:Message-Id:Mime-Version: Subject:Date:To; b=rFliglU+2Ieazdd2YTyGsLRob4jo7MVjEH4ZlgJyyhMQuAMnkesqPwws2ExjuvOoF SPpEqhL7i7ygISzn5zS8lgKUflet1ZGkUEmjuOQYKL+2SGiTpfehIQpXyD9sCXpXX9 OH5FQF6KcrdWJ+c5la3USvobQLAXLLmvzKybDPJG5H/xkTj3fLm4leEDwaIWzOQ7TX dR2FxeoyDwMQq7BKYi1YRR7MaXBzt9lmyoAbH4mguCSfsuNHrn4kLLevN+im4fi/uc B9E7/JYC4LzqVo2AQcBrrc0a29m5sih1dkzHMeuMixySVgREPZlmF8FxvBs+ec/A+W eTXb9Jn9zbjFQ== X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_ABB7CB24-088B-4738-91D0-35FC36733373 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Nov 7, 2013, at 1:24 PM, Christopher Schultz = wrote: > But nobody in their right mind uses > "../../../.." to get to the context-path (which, by definition is > relative to the host)... instead they use request.getContextPath() and > then tack-on a context-relative link to the end of it. You keep saying this but you have yet to explain why the practice is so = intrinsically bad. > I'm not saying that you can't make "pure" relative links work. I'm > just saying that writing robust software has led me to make certain > decisions about the way things "ought" to be.. and this is one of = them. Again, you have yet to give a convincing reason why things "ought" to be = that way. Baking in the context-path has the effect of introducing a = runtime requirement into the final product. Specifically, it demands = that whatever path an application is deployed to in Tomcat be maintained = all the way back to the user's browser. Now if there's a good reason for = having that requirement, fine. But if not, why add it? > So, how do you set that value? Do you have a Filter that takes the > current URL and calculates how many "../" you need to put on it to get > back to the context-root, then stick it in the request? That sounds > like more work to me than this: >=20 > Users > Admins > Public >=20 > ... and no Filter to fix things up for me. It will also work in the > cases where the Filter does not run for some reason (maybe it's not > configured for all URLs, so 404s slip-through, etc.). Yes, somebody has to write that filter, or if they're already building a = framework for other reasons they can include that functionality. Either = way, it's a small, one-time investment. Application developers don't = have to worry about it. They just plug it in and go. As for a filter not catching things, that's a bug and should be detected = by testing. If it's not, you've got a management problem, not a = technical one. - Milo Hyson Chief Scientist CyberLife Labs, Inc. --Apple-Mail=_ABB7CB24-088B-4738-91D0-35FC36733373--