Return-Path: Delivered-To: apmail-incubator-abdera-dev-archive@locus.apache.org Received: (qmail 53764 invoked from network); 19 Jun 2008 15:01:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Jun 2008 15:01:55 -0000 Received: (qmail 71370 invoked by uid 500); 19 Jun 2008 15:01:14 -0000 Delivered-To: apmail-incubator-abdera-dev-archive@incubator.apache.org Received: (qmail 70816 invoked by uid 500); 19 Jun 2008 15:01:12 -0000 Mailing-List: contact abdera-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: abdera-dev@incubator.apache.org Delivered-To: mailing list abdera-dev@incubator.apache.org Received: (qmail 69590 invoked by uid 99); 19 Jun 2008 15:01:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jun 2008 08:01:08 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jasnell@gmail.com designates 64.233.166.183 as permitted sender) Received: from [64.233.166.183] (HELO py-out-1112.google.com) (64.233.166.183) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jun 2008 14:49:41 +0000 Received: by py-out-1112.google.com with SMTP id u52so302987pyb.13 for ; Thu, 19 Jun 2008 07:49:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=9FER0vyAlGCyFNnaQEmuFRFOiASbzkJs2VBZe21FPNk=; b=kgS4tZS4DElKVqmiTStVsft6+rPHHPH8QMMheKilxazp6x1rp0p8OiEYIGV8mh51Ze v3S7T/14EdoISSkRSqJYagSFJhi5UMnda6D6e0+VRqhpYqeafpj+9Jdwh1dzU2tdiG6B mpY3PqYhYtzEG4An7RDB0qxOV5gnccPqwefSo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=suL6Zhc8PxKNjkTLjsCJt2skbW3qYWH44D+7cq8tJC5lyX8ZOWYplMNJbqBuOaLWHp L9ZDOKYum9aDq4dhRbtGIpRnH8Ny21VYUO9eqpqPeyjD7OYCfuJpT0RpZ6VlckzZpUlC I9kdrYDZgL4/0az5xT3ERgSe/Blcmip3+mfuE= Received: by 10.35.71.17 with SMTP id y17mr28082pyk.0.1213886994694; Thu, 19 Jun 2008 07:49:54 -0700 (PDT) Received: from ?192.168.2.105? ( [98.224.93.96]) by mx.google.com with ESMTPS id z80sm91192pyg.31.2008.06.19.07.49.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 19 Jun 2008 07:49:38 -0700 (PDT) Message-ID: <485A71C6.4000707@gmail.com> Date: Thu, 19 Jun 2008 07:48:38 -0700 From: James M Snell User-Agent: Thunderbird 2.0.0.14 (X11/20080505) MIME-Version: 1.0 To: abdera-dev@incubator.apache.org Subject: Re: Route matching too liberal? References: <47ABCD89.10400@anconafamily.com> <47ABD8B8.4070705@gmail.com> <17993519.post@talk.nabble.com> In-Reply-To: <17993519.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Works for me. Would you be interested in writing up a patch and submitting it to jira? If not, I could work up the change but it may take a few days longer as I'm trying disparately to get caught up on some day job stuff. - James ed_ruder wrote: > James, > > I'm not very familiar with Abdera, but I have browsed the source a bit after > hitting the same limitation that Jim reported, while working on Shindig. I > *think* that a simple change in RouteManager could alleviate some (and for > me, I think, all) of the limitation. > > When resolving a route, Rails walks through its routes in the order that > they are defined. RouteManager walks through the targets.entrySet, which is > unordered. If RouteManager kept a targets List<> instead of a targets Map<>, > it could walk through the routes in order. (There would need to be a new > class defined, to hold both the Route and TargetType, but it would be very > simple.) > > To work around the limitation Jim describes, a client would define a > /base/:collection/:entry route before the /base/:collection route. > > WDYT? > > Ed > > > James M Snell wrote: >> Ruby matching can span segments if a default value for the missing >> variables is provided. We, however, don't have default values for our >> variables. It would make sense for us to tighten up the matching rules. >> >> - James >> >> Jim Ancona wrote: >>> I have run into some problems with my Routes matching unexpectedly. >>> Before filing a bug, I thought I'd ask for feedback on whether the >>> current behavior is correct. >>> >>> The current algorithm attempts to match the non-variable parts of the >>> pattern, setting the variable to whatever is in between. >>> >>> So the pattern "/base/:collection/" matches both "/base/test/" and >>> "/base/test/123/". In the second case, the value of the collection >>> variable is "test/123". In my opinion, not allowing matches to span URI >>> segments would be less prone to unintuitive results. >>> >>> FWIW, a quick glance at some docs on Ruby Routes seems to indicate that >>> they do not span URI path segments. >>> >>> Thoughts? >>> >>> Jim >>> >> >