cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-5432) JAX-RS resources finding fails in case @Path is non-unique
Date Tue, 03 Dec 2013 17:44:54 GMT

    [ https://issues.apache.org/jira/browse/CXF-5432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13837941#comment-13837941
] 

Sergey Beryozkin commented on CXF-5432:
---------------------------------------

It is not an implementation specific limitation, it just the way it is supposed to work in
JAX-RS 1.1.
Even though it is done in CXF 3.0.0 m1, I'd still recommend not to rely on it if possible,
it is just more expensive to match when multiple root resources with exactly the same path
are used.
Logging in 2.7.x will be expensive, we'd need to actually check all the matching root resources
instead of selecting the 1st one. Please use CXF ResourceComparator if needed

> JAX-RS resources finding fails in case @Path is non-unique
> ----------------------------------------------------------
>
>                 Key: CXF-5432
>                 URL: https://issues.apache.org/jira/browse/CXF-5432
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.7.6
>            Reporter: Valentin Mayamsin
>            Assignee: Sergey Beryozkin
>            Priority: Minor
>
> Let's say I have two resources:
> {code}
> @Path("resource")
> class ResourceOne {
>     @Path("one")
>     String getSomething();
> }
> @Path("resource")
> class ResourceTwo {
>     @Path("two")
>     String doSomething();
> }
> {code}
> So there are two URIs to access them:
> resource/one
> resource/two
> With the current implementation one of them would fail.
> The reason is org.apache.cxf.jaxrs.model.ClassResourceInfoComparator assumes @Path values
are unique which is not necessarily true.
> Workaround is to make @Path value unique for root resources.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message