You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Sergey Beryozkin (JIRA)" <ji...@apache.org> on 2014/08/06 14:56:12 UTC

[jira] [Comment Edited] (CXF-5920) JAX-RS Link implementation (LinkBuilder) looses context path

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

Sergey Beryozkin edited comment on CXF-5920 at 8/6/14 12:54 PM:
----------------------------------------------------------------

I'm not sure what it is to do with Jersey but I was definitely able to reproduce the problem in CXF. I'll deal with this issue...


was (Author: sergey_beryozkin):
I'm not sure what it is to do with Jersey but I was definitely was able to reproduce the problem in CXF. I'll deal with this issue...

> JAX-RS Link implementation (LinkBuilder) looses context path  
> --------------------------------------------------------------
>
>                 Key: CXF-5920
>                 URL: https://issues.apache.org/jira/browse/CXF-5920
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.0.1
>            Reporter: Ioan Eugen Stan
>
> I think I've discovered a bug in CXF, but I'm not sure. Link class
> messes links up, and doesn't include servlet and @ApplicationPath
> paths from BaseUri:
> Description:
> - I have CdiServlet deployed at '/rest',
> - I have Jax rs @ApplicationPath '/api'
> - Account resource at  /account
> I expect the following code to return links to my resources:
> ~~~
>         log.info(" -- <<>> {}", uri.getBaseUri());
>         return Response.ok().links(
> Link.fromResource(AccountResource.class).baseUri(uri.getBaseUri()).rel("account").build(),
>   Link.fromResource(PlatformResource.class).baseUri(uri.getBaseUri()).rel("self").build()
> ).build();
> ~~~
> However, I get this on the client side:
> ~~~
> Link=[<http://localhost:9001/>;rel="self",
> <http://localhost:9001/account>;rel="account"],
> ~~~
> And I expected links with full path. like ttp://localhost:9001/rest/api/account
> UriInfo returns the correct uri. Link messes it up.
> ~~~
> INFO  PlatformResource -  -- <<>> http://localhost:9001/rest/api
> ~~~



--
This message was sent by Atlassian JIRA
(v6.2#6252)