docs: public static String currentRequestContextPath() {
  
          final RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
  
          if (null == requestAttributes) {
              throw new IllegalStateException(
                      "Request attributes are not bound.  "
                              + "Not operating in context of a Spring-processed Request?");
          }
  
          if (requestAttributes instanceof ServletRequestAttributes) {
  
              final ServletRequestAttributes servletRequestAttributes =
                      (ServletRequestAttributes) requestAttributes;
              final HttpServletRequest request = servletRequestAttributes.getRequest();
              return request.getContextPath();
  
          } else if (requestAttributes instanceof PortletRequestAttributes) {
  
              final PortletRequestAttributes portletRequestAttributes =
                      (PortletRequestAttributes) requestAttributes;
              final PortletRequest request = portletRequestAttributes.getRequest();
              return request.getContextPath();
  
          } else {
              throw new IllegalStateException(
                      "Request attributes are an unrecognized implementation.");
          }
      }