JSF 2 How to resolve Resource URLs in UIComponents
In JSF 2, a great EL shortcut was introduced to get the url for resources using #resource['/library/image.jpg'].
I would like to get the URL of an image inside a custom component using an equivalent java syntax. The image resource lies inside META-INF/resources/library, and I couldn't find any convenient way of referencing the path of image when writing an "img" tag inside my UIComponent.
I have been looking around facesContext.getApplication().getResourceHandler(), but resource handler has no such method to find a resource in META-INF/resources.
Please let me know what is the best method of resolving such resources inside a component.