users@jersey.java.net

[Jersey] Using relative urls

From: ravthiru <ravthiru_at_gmail.com>
Date: Sun, 5 Mar 2017 18:15:55 -0700 (MST)

I am not able to fetch the resource using relative URL .


Page URL is http://localhost:8080/page/123
Image url is http://localhost:8080/image/1001

While retrieving Page i send relative urls of the images,
later i want to retrieve images using the base url

I used below code to get the images, but it end up with resource not found
(404)

     String base = "http://localhost:8080/page";
      String path = "../image/1001";
      WebTarget target = ClientBuilder.newClient().target(base);
      target=target.path(path);
      response = target.request().get();

Is this correct way to use relative URl



--
View this message in context: http://jersey.576304.n2.nabble.com/Using-relative-urls-tp7583941.html
Sent from the Jersey mailing list archive at Nabble.com.