code: public static String getRequestURI(HttpServletRequest httpRequest) {
          final StringBuilder url = new StringBuilder(100).append(httpRequest.getRequestURI());
          if (httpRequest.getQueryString() != null) {
              url.append('?').append(httpRequest.getQueryString());
          }
  
          return url.toString();
      }
docs: Returns the URI of the given request.
  
  @param httpRequest    an HTTP servlet request
  @return the URI, including the query string