« Return to Thread: JAX-RS : initial WADL support

Re: JAX-RS : initial WADL support

by Sergey Beryozkin :: Rate this Message:

Reply to Author | View in Thread

Hi Gabo

Please send me a copy...

Unfortunately it is not possible to have multiple root resource classes with the same Path value. Actually, it is possible, but JAX-RS specs says that after the first root class has been selected it is this resource only that the runtime continues working with, others are not checked.
We've discussed a couple of times the idea of extending the implementation such that if the first matching resource has no matching operation then then next matching one, if any, is tried next.

cheers, Sergey

Gabo Manuel wrote:
Hi Sergey,

Sergey Beryozkin wrote:
> I'm not sure we can do it at the XML level, XML Parsers used by Firefox/IE would just most likely
> skip it as the ignorable whitespaces. HTML WADL view will also be done/available later on and it will make the whole WADL instance more readable, I was thinking to utilize Mark Nottingham's stylesheet but then I looked at it again and decided to step back and may be come up with something CXF-specific.
>  
I was viewing it via notepad++. I'll send you a copy directly.

> Now, about 2.
>
> I've been surprised recently to find out root resources with no root Path annotations can be matched, I think in this case CXF just assumes it's @Path("/").
> So in your case you have 2 root resource classes, one with @Path("/") and one with @Path("/Service").
> When you do
>  
I haven't done it yet, but I am seriously planning to. But is it
possible to have two classes to have the same path annotation? I am
thinking of having two services with no path annotations (which as you
said defaults to "/")

> /Service/?_wadl
>
> the one with @Path("/Service") will be selected as per the JAX-RS selection algorithm. And the WADL generator operates with this class only...
>  
I was thinking the "/Service/operation" of class2 should also be
included since the path would still match and this would be similar to
the result of actually invoking the said service.

Gabo

 « Return to Thread: JAX-RS : initial WADL support