docs: static public String toResourceUri(FacesContext facesContext, Object o)
      {
          if (o == null)
          {
              return null;
          }
  
          String uri = o.toString();
  
          // *** EL Coercion problem ***
          // If icon or image attribute was declared with #{resource[]} and that expression
          // evaluates to null (it means ResourceHandler.createResource returns null because 
          // requested resource does not exist)
          // EL implementation turns null into ""
          // see http://www.irian.at/blog/blogid/unifiedElCoercion/#unifiedElCoercion
          if (uri.length() == 0)
          {
              return null;
          }
  
          // With JSF 2.0 url for resources can be done with EL like #{resource['resourcename']}
          // and such EL after evalution contains context path for the current web application already,
          // -> we dont want call viewHandler.getResourceURL()
          if (uri.contains(ResourceHandler.RESOURCE_IDENTIFIER))
          {
              return uri;
          }
  
          // Treat two slashes as server-relative
          if (uri.startsWith("//"))
          {
              return uri.substring(1);
          }
          else
          {
              // If the specified path starts with a "/",
              // following method will prefix it with the context path for the current web application,
              // and return the result
              String resourceURL = facesContext.getApplication().getViewHandler()
                      .getResourceURL(facesContext, uri);
              return facesContext.getExternalContext().encodeResourceURL(
                      resourceURL);
          }
      }