code: public static URL getResourceUrl(FacesContext ctx, String path) throws MalformedURLException
      {
          final ExternalContext externalContext = ctx.getExternalContext();
          URL url = externalContext.getResource(path);
          if (log.isLoggable(Level.FINE))
          {
              log.fine("Resource-Url from external context: " + url);
          }
          if (url == null)
          {
              // This might happen on Servlet container which doesnot return
              // anything
              // for getResource() (like weblogic 8.1 for packaged wars) we
              // are trying
              // to use an own URL protocol in order to use
              // ServletContext.getResourceAsStream()
              // when opening the url
              if (resourceExist(externalContext, path))
              {
                  url = getUrlForResourceAsStream(externalContext, path);
              }
          }
          return url;
      }
docs: Get an URL of an internal resource. First, {@link javax.faces.context.ExternalContext#getResource(String)} is
  checked for an non-null URL return value. In the case of a null return value (as it is the case for Weblogic 8.1
  for a packed war), a URL with a special URL handler is constructed, which can be used for <em>opening</em> a
  serlvet resource later. Internally, this special URL handler will call
  {@link ServletContext#getResourceAsStream(String)} when an inputstream is requested. This works even on Weblogic
  8.1
  
  @param ctx
  the faces context from which to retrieve the resource
  @param path
  an URL path
  
  @return an url representing the URL and on which getInputStream() can be called to get the resource
  @throws MalformedURLException