public static Resource evaluateResourceExpression(FacesContext facesContext, ValueExpression valueExpression) {
        Resource resource = null;

        if (valueExpression != null) {
            String expressionString = valueExpression.getExpressionString();

            Matcher matcher = RESOURCE_PATTERN.matcher(expressionString);
            if (matcher.find()) {
                String[] resourceInfo = matcher.group(1).split(":");

                Application application = facesContext.getApplication();
                ResourceHandler resourceHandler = application.getResourceHandler();

                if (resourceInfo.length == 2) {
                    String resourceLibrary = resourceInfo[0];
                    String resourceName = resourceInfo[1];
                    resource = resourceHandler.createResource(resourceName, resourceLibrary);
                }
                else {
                    String resourceName = resourceInfo[0];
                    resource = resourceHandler.createResource(resourceName);
                }
            }
        }

        return !isResourceNotFound(resource) ? resource : null;
    }
Per default the Faces implementation evaluates resource expressions as String and returns {@link Resource#getRequestPath()}.
This method resolves the expression to the {@link Resource} itself.

@param facesContext The {@link FacesContext}
@param valueExpression The {@link ValueExpression}

@return Null if the valueExpression is not of the form #{resource['path/to/resource']} or #{resource['library:name']}.
Otherwise the value obtained by {@link ResourceHandler#createResource(java.lang.String)}.
primefaces/src/main/java/org/primefaces/util/ResourceUtils.java