users@jsr311.java.net

Re: Matching requests to subresource methos

From: Stephan Koops <Stephan.Koops_at_web.de>
Date: Fri, 07 Mar 2008 17:21:19 +0100

Hello Sergey,
> But in my example I'm referring to a subresource method :
>
> @Path("/")
> class SomeClass {
> @GET
> @Path("bar")
> public Bars getBars() {}
> }
>
> getBars() is a subresource method ?
oh yes, you are right.
> > I think, for "/bar/" it's right, because the condition for the break
> is:
> > If U is null or ‘/’ go to step 3.
> My reading of the spec is that no match would be found when a " GET /bar/"
> request is issued to
> @Path("/")
> class SomeClass {
> @GET
> @Path("bar")
> public Bars getBars() {
> }
>
> @Path("bar")
> public SomeClass getBarsLocator() {
> return this;
> }
> }
> as getBars() will be eliminated due to a final matching group
> containing "/".
> getBarsLocator() will be selected instead but no resource method will
> be found with a URITemplate matching '/'
> Do you agree ?
No, getBars() will not eliminated in section 2.6, step 2.d.2. cite:
"final matching group is NOT empty or ‘/’."
Or which final matching group do you mean?

regards
Stephan