code: public static String absoluteHrefOf(final String path) {
          try {
              return fromCurrentServletMapping().path(path).build().toString();
          } catch (final IllegalStateException e) {
              return path;
          }
      }
docs: Returns an absolute URL for the specified path.
  
  Example: If the current request URL is http://example.org/helloworld/internal/status,
  {@code absoluteHrefOf("/internal/health")} will return http://example.org/helloworld/internal/health (with
  helloworld as servletContextPath).
  
  This method relies on Spring's {@link org.springframework.web.context.request.RequestContextHolder} to find
  the current request.
  
  @param path the relative url path
  @return returns the absolute href of the given path