users@jsr311.java.net

Re: more comments to JSR311

From: Bill Burke <bburke_at_redhat.com>
Date: Tue, 25 Mar 2008 12:20:30 -0400

Stephan Koops wrote:
> *_at_Context on PathSegment?*
> What about @Context also allowed on type PathSegment? I know that it is
> also possible by using UriInfo.getPathSegments() and then fetch the
> last, but this raises the useability. It should be the last parsed path
> segment:
>
> * On a resource method the PathSegment that was parsed while looking
> for the resource class (if it is a root resource class that from
> @Path of the class)
> * On a sub resource method or locator it is the one from @Path of
> the java method.
>

A @Path can be multiple path segments. So I don't see what you are
saying here.

I'm pretty sure you can do this:

@Path("/customers/{id}"
public String get(@PathParam("id") PathSegment id) {...}

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com