jersey
  1. jersey
  2. JERSEY-1801

ResponseBuilder#links adds only the first link

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0-m13
    • Fix Version/s: 2.0-rc1, 2.0
    • Component/s: core
    • Labels:
      None

      Description

      On Resource:

      @Path("resource")
      public class ResponseTest {
      	@GET
      	@Path("links")
      	public Response getLinks() {
      		Link link1 = createLink("path1", "rel1");
      		Link link2 = createLink("path2", "rel2");
      		Response response = Response.ok().links(link1, link2).build();
      		return response;
      	}
      	protected static Link createLink(String path, String rel) {
      		return Link.fromUri(createUri(path)).rel(rel).build();
      	}
      
      	protected static URI createUri(String path) {
      		URI uri;
      		try {
      			uri = new URI("http://localhost.xyz:888/url404/" + path);
      		} catch (URISyntaxException e) {
      			throw new RuntimeException(e);
      		}
      		return uri;
      	}
      

      On request:

      GET http://localhost:8080/resource/links

      The following response is given:

      << 200 OK
      << Link: <http://localhost.xyz:888/url404/path1>; rel="rel1"
      << Date: Mon, 18 Mar 2013 12:22:49 GMT
      << Content-Length: 0

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Marek Potociar
            Reporter:
            jan.supol
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 3 hours
              3h