Nov 8, 2018

Web Resources in JSF

Web resources are any software artifacts that the web application requires for proper rendering, including images, script files, and any user-created component libraries. Resources must be collected in a standard location, which can be one of the following.

A resource packaged in the web application root must be in a subdirectory of a resources directory at the web application root: resources/resource-identifier.

A resource packaged in the web application’s classpath must be in a subdirectory of the META-INF/resources directory within a web application: META-INF/resources/resource-identifier. You can use this file structure to package resources in a JAR file bundled in the web application.

The JavaServer Faces runtime will look for the resources in the preceding listed locations, in that order.

Example usage:
<h:outputStylesheet library="css" name="i88.ca.css"/>
<h:graphicImage value="#{resource['images:i88.ca.gif']}"/>