docs: public static String getIconSrc(final FacesContext facesContext,
              final UIComponent component, final String attributeName)
      {
  
          // JSF 2.0: if "name" attribute is available, treat as a resource reference.
          final Map<String, Object> attributes = component.getAttributes();
          final String resourceName = (String) attributes.get(JSFAttr.NAME_ATTR);
          if (resourceName != null && (resourceName.length() > 0))
          {
  
              final ResourceHandler resourceHandler = facesContext
                      .getApplication().getResourceHandler();
              final Resource resource;
  
              final String libraryName = (String) component.getAttributes().get(
                      JSFAttr.LIBRARY_ATTR);
              if ((libraryName != null) && (libraryName.length() > 0))
              {
                  resource = resourceHandler.createResource(resourceName,
                          libraryName);
              }
              else
              {
                  resource = resourceHandler.createResource(resourceName);
              }
  
              if (resource == null)
              {
                  // If resourceName/libraryName are set but no resource created -> probably a typo,
                  // show a message
                  if (facesContext.isProjectStage(ProjectStage.Development))
                  {
                      String summary = "Unable to find resource: " + resourceName;
                      if (libraryName != null)
                      {
                          summary = summary + " from library: " + libraryName;
                      }
                      facesContext.addMessage(
                              component.getClientId(facesContext),
                              new FacesMessage(FacesMessage.SEVERITY_WARN,
                                      summary, summary));
                  }
  
                  return RES_NOT_FOUND;
              }
              else
              {
                  return resource.getRequestPath();
              }
          }
          else
          {
              String value = (String) component.getAttributes()
                      .get(attributeName);
              return toResourceUri(facesContext, value);
          }
      }