Hi Adam,

This is indeed a frequently asked question, but it didn't have a FAQ entry
yet :) So I just had to write it:
http://www.restlet.org/documentation/1.0/faq#24

Best regards,
Jerome  

> -----Message d'origine-----
> De : Adam Taft [mailto:[EMAIL PROTECTED] 
> Envoyé : samedi 16 juin 2007 02:16
> À : [email protected]
> Objet : Preventing Greedy URL Matching
> 
> Hi,
> 
> I'm sure this has got to be a FAQ for Restlet, so sorry in 
> advance for 
> such a simple question...
> 
> I've got a restlet attached to an example URL like:
> 
> /example/{id}/
> 
> I want the library to return a 404 for URLs with anything 
> trailing.  Ie.
> 
> /example/{id}/foo
> /example/{id}/whatever/xyz/blah...
> 
> How can I make the matching more "strict" and thus not accept 
> the extra 
> path.  I can do this manually per request by looking at the 
> request.getResourceRef().getRemainingPart().  But it's seems kind of 
> silly to have to do this on every request.  Seems like it would be 
> better a part of the Router matching or something.
> 
> Thanks for any advice on this.
> 
> By the way, getRemainingPart() returns an empty string for a 
> request to 
> /example/{id}/  I'm wondering if this shouldn't return NULL instead.
> 
> Related, getSegments() on the above returns: [example, $id, ] 
>  See the 
> extra item in the segment list??  Yuck.
> 
> Thanks,
> 
> Adam

Reply via email to