The purpose of this enhancement request is to make it easier to reference
resource URLs in custom components.
In JSF 2, a great EL shortcut was introduced to get the url for resources using
the resource implicit object (e.g. #resource['/library/image.jpg']). But there
is no easy programmatic way of resolving resource URLs inside a custom
component. For example if an image resource lies inside
META-INF/resources/library/image.jpg, there is no convenient way of referencing
the path of the image when writing an "img" tag inside my UIComponent.
Ideally such method should exist in ResourceHandler and users can invoke it
but resource handler has no such method to find a resource in META-INF/resources.
In lieu of this, you can do the following (Suggested by Ed Burns):
ResourceHandler rh = facesContext.getApplication.getResourceHandler();
Resource r = rh.createResource("image.jpg", "library");
This would work, but it is not as nice as getResourceHandler().getRequestPath().
This will give Component developers some ease, especially when there are