dev@jsr311.java.net

Removing _at_UnmatchedPath

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Mon, 02 Jul 2007 16:18:26 -0400

The @UnmatchedPath annotation was intended to be used to provide
access to the unmatched part of a URI path thus:

@UriTemplate("folders")
public class Path {

   @HttpMethod(GET)
   public Response getContent(@UnmatchedPath String path) {
     ...
   }
}

On further thought we think a cleaner and more intuitive solution
would be to add a property to UriTemplate that would enable
"greedy" (can anyone think of a better word) matching for a
terminating URI template parameter. E.g.

@UriTemplate(value="folders/{path}" greedy=true)
public class Path {

   @HttpMethod(GET)
   public Response getContent(@UriParam("path") String path) {
     ...
   }
}

Using the above and a request for folders/foo/bar, the value of path
would be "foo/bar".

Thoughts, comments ?
Marc.

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.