Hi Alex,

Using the latest RC4 release, you can very easily handle this case using URI
variables. Check this tutorial section for an example on how to define URI
templates and how to get the variable values extracted via the request
attributes: http://www.restlet.org/tutorial#part12

Best regards,
Jerome  

> -----Message d'origine-----
> De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la 
> part de Alex Milowski
> Envoyé : vendredi 23 février 2007 07:54
> À : [email protected]
> Objet : Request Patterns and Parsing Paths
> 
> I'm very interested in trying out the restlet project.  One 
> very typical
> thing that I do is use a servlet filter on the request to parse
> out parameters from the request path.  
> 
> For example, I might have a URI like: 
> 
>   http://www.example.com/id/1234
> 
> Using something like Tomcat & urlrewrite (see 
> http://urlrewrite.dev.java.net)
> I can write a regex that picks out the '1234' part and turns 
> it into a 
> request parameter.  This is all done in a filter *before* the 
> request hits
> the servlet.
> 
> Looking at the restlet API, it looks like I can register a 
> pattern of "/id/\d+" 
> with the Router instance but I don't see how I can maintain the
> result of applying the regex.  Basically, I want to capture part of
> the regex in a group (e.g. "/id/(\d+)" ) and then do 
> something with it 
> to allow the handling code to use the segment of the path that
> was parsed already once.
> 
> Can I do this right now somehow with the restlet API & implementations
> available ?
> 
> --Alex Milowski
> 
> 

Reply via email to