users@jersey.java.net

Re: [Jersey] Binding resource to base uri

From: ???? ????????? <sunsunich_at_gmail.com>
Date: Tue, 10 Mar 2009 17:14:04 +0300

>It would be of great help if you could try debugging the
>ServletContainer.service method on WebSphere? and reporting back how
>things behave?

Here is variables from websphere debug session, hope it helps.

before UriBuilder absoluteUriBuilder =
UriBuilder.fromUri(request.getRequestURL().toString());

"request.getPathInfo()"= null
"request.getRequestURI()"= "/webapp/resource/"
"request.getRequestURL().toString()"= "http://localhost:9081/webapp/resource/"
"request.getContextPath()"= "/webapp"

"decodedBasePath" = "/webapp/"

absoluteUriBuilder.paths contains 3 elements ["webapp","resource", ""]

>final URI baseUri = absoluteUriBuilder.replacePath(encodedBasePath).
                build();

"baseuri.toString()" = "http://localhost:9081/webapp/"

>final URI requestUri = absoluteUriBuilder.replacePath(request.getRequestURI()).
                replaceQuery(queryParameters).
                build();

requestUri.toString() = "http://localhost:9081/webapp/resource/"

If I`ve missed something, please, let me know.

Best regards,
Saiid.