Hi Frank,
Yes, nice catch. This is related to matching. If you have the following:
"/{tenant}/providers"
"/{tenant}/member"
They are converted to the regular expressions:
"/(.*?)/providers"
"/(.*?)/member"
Notice that the capturing groups are reluctant, hence why one can do
this "{a}/{b}/{c}". Also notice that the capturing groups don't
explicitly rule out '/' being present.
The JAX-RS algorithm does not know at what might be next in terms of
matching in terms of sub-resource methods and locators (there is no
complete static view of the URI space).
You can work around this by having one root resource of "{tenant}" and
two sub-resource locators of "providers" and "member". Alternatively you
can have root resources of "/{tenant}/providers", "/{tenant}/member",
and "/{tenant}/member/{id}".
However, i think we may need to have a capturing group as follows:
/([^/]*?)
But we need to make sure that a "limited=false" template is still:
(.*?)
(Incidentally we will be modifying the capturing group to be "(+?)")
I will follow up with Marc on this.
Paul.
FSauer_at_dsthealthsolutions.com wrote:
>
>
> http://localhost:8080/services/clientd/members/xxx/providers?v=1
>
>
> causes an interesting problem related to (I suspect) eager versus lazy
> evaluation of regular expressions
>
>
> We have these two toplevel resource classes annotated with:
>
> @Path("/{tenant}/providers")
>
> and
>
> @Path("/{tenant}/members")
>
> the last one has a method annotated with:
>
> @GET
> @Path("{id}/providers")
> @ProduceMime("application/xml")
>
>
> and I want to given URI to match "/{tenant}/members/{id}/providers"
> with tenant=clientd and id=xxx, however, it ends up in
> "/{tenant}/providers" with tenant=clientd/members/xxx
>
>
> Is that per spec or is this a bug?
>
>
> Frank
>
> ------------------------------------------------------------------------
>
> * This e-mail and any attachments are intended only for the individual
> or company to which it is addressed and may contain information which is
> privileged, confidential and prohibited from disclosure or unauthorized
> use under applicable law. If you are not the intended recipient of this
> e-mail, you are hereby notified that any use, dissemination, or copying
> of this e-mail or the information contained in this e-mail is strictly
> prohibited by the sender. If you have received this transmission in
> error, please return the material received to the sender and delete all
> copies from your system. *
>
--
| ? + ? = To question
----------------\
Paul Sandoz
x38109
+33-4-76188109