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,