code: public static String getUrl(String path) {
          if (path == null) {
              return path;
          }
  
          ServletContext sc = ExecutionContext.getSession().getServletContext();
  
          if (path.startsWith("jar:")) {
              int i = path.indexOf("!");
              path = i < 0 ? path : path.substring(++i);
          }
  
          path = sc.getContextPath() + path;
          return path;
      }
docs: Returns a URL string representing the root path and context path.
  
  @param path Relative path to expand.
  @return The fully expanded URL.