cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ellen <>
Subject The logic of Response getAllLinks method is not good?
Date Tue, 28 Apr 2015 06:19:54 GMT
Hi all,

I'm using response getLink method from CXF.

The code is:

    private Map<String, Link> getAllLinks() {
        List linkValues = metadata.get(HttpHeaders.LINK);
        if (linkValues == null) {
            return Collections.emptyMap();
        } else {
            Map<String, Link> links = new LinkedHashMap<String, Link>();
            for (Object o : linkValues) {
                Link link = o instanceof Link ? (Link)o :
                if (!link.getUri().isAbsolute()) {
                    *URI requestURI =
                    link = Link.fromLink(link).baseUri(requestURI).build();
                links.put(link.getRel(), link);
            return links;

But from the code you can see therequestURI comes from Message REQUEST_URI.

If my request uri is

then I continue use the link to invoke like this:

Link link = response.getLink(linkName);
response = client.invocation(link).post(null);

The url which response use is joined like this:,

but this is not exist (correct lin
should be So I think this is not good.

I'm looking at Jersey getLink method, and found they use:
URI result = baseUri.resolve(refUri);

to get Request url, and I found the result is correct for me.

Could you please take a look this issue?

Thanks a lot!

View this message in context:
Sent from the cxf-dev mailing list archive at

View raw message