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.replaceQuery(absolute.getQuery());
absolutePath = builder.build();