try
{
URL absolute = new URL(request.getRequestURL().toString());
UriBuilderImpl builder = new UriBuilderImpl();
builder.scheme(absolute.getProtocol());
builder.host(absolute.getHost());
builder.port(absolute.getPort());
builder.path(absolute.getPath());
builder.replaceQueryParams(absolute.getQuery());
absolutePath = builder.build();