A Web application commonly requires resources to run—associated files such as Java-Script, CSS, images, or other Facelets pages. JSF 2.0 has introduced the
ResourceHandler API to serve resources.
ResourceHandler defines a path-based packaging convention for resources. After
ViewHandler has rendered a view and the browser has parsed the completely rendered page, the browser requests for the resources are included in the page. The Faces servlet invokes the
ResourceHandler.isResourceRequest() method to determine if the request is for a resource. If the method returns
true, the Faces servlet invokes the
ResourceHandler.handleResourceRequest() method to handle the resource request. A resource is represented with the