users@jsr311.java.net

Re: Path annotations for class resources

From: Sergey Beryozkin <sergey.beryozkin_at_iona.com>
Date: Wed, 27 Feb 2008 17:31:03 -0000

Thanks...

here's another question.

If a @Path annotation for a root resource contains template variables then how are they applied to diferrent resource methods ?
For ex :

@Path("/foo/{id1}")
class Foo {

@GET
public Bar getBar(@PathParam String id1) {
}

@GET
Path("bar")
public Bar getSubresourceMethodBar(@PathParam String id1) {
}
}

So GET /foo/1 will be mapped to getBar(String id1).

What about getSubresourceMethodBar() ?

Section 2.5.2 ("Obtain the object which will handle request") says that the final capturing group obtained in a previous step,
will be used to select either subresource methods or locators. So, for GET /foo/1/bar

/bar will be the final capturing group.

In this case, can a subresource method/locator still expect a parameter initialized given that a template belongs to a class resource @Path ?

Cheers, Sergey

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland