users@jsr311.java.net

Re: Matching requests to subresource methos

From: Stephan Koops <Stephan.Koops_at_web.de>
Date: Fri, 07 Mar 2008 15:50:52 +0100

Hello Sergey
> By the way, I thought ProduceMime is an optional thing, the default is
> "*\*" ?
yes, but the spec require, that it could determine a concrete media
type. If your method produce "*/*" and require "*/*", the runtime has no
posibility to determine a concrete media type.
If the method returns a javax.ws.rs.Response, then you could set the
media type into the Response, and the runtime could call the method with
every media type.
> For example :
> @Path("/")
> class SomeClass {
>
> @GET
> @Path("bar")
> public Bars getBars() {}
> @GET
> @Path("bar/{id}")
> public Bar getBar(@PathParam String id) {}
>
> }
> At the moment, CXF wrongly matches /bar/1 request to getBars(). Both
> methods match "bar/1", but in case of getBars the final matching group
> is "/1", thus, according 2.5.2.d section, getBars() needs to be
> eliminated, If it's correct then the same should happen for "/bar/"...
I think, for "/bar/" it's right, because the condition for the break is:
If U is null or ‘/’ go to step 3.

best regards
Stephan