public class CombinedResourceHandler
extends javax.faces.application.ResourceHandlerWrapper
implements javax.faces.event.SystemEventListener
ResourceHandler implementation will remove all separate script and stylesheet resources from the head
and create a combined one for all scripts and another combined one for all stylesheets.
This handler must be registered as follows in faces-config.xml:
<application> <resource-handler>org.omnifaces.resourcehandler.CombinedResourceHandler</resource-handler> </application>
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
LIBRARY_NAME
The default library name of a combined resource.
|
| Constructor and Description |
|---|
CombinedResourceHandler(javax.faces.application.ResourceHandler wrapped)
Creates a new instance of this combined resource handler which wraps the given resource handler.
|
| Modifier and Type | Method and Description |
|---|---|
javax.faces.application.Resource |
createResource(java.lang.String resourceName,
java.lang.String libraryName) |
javax.faces.application.ResourceHandler |
getWrapped() |
void |
handleResourceRequest(javax.faces.context.FacesContext context) |
boolean |
isListenerForSource(java.lang.Object source)
Returns true if the source is an instance of
UIViewRoot. |
void |
processEvent(javax.faces.event.SystemEvent event)
Before rendering of a freshly created view, perform the following actions:
Collect all component resources from the head.
|
public static final java.lang.String LIBRARY_NAME
public CombinedResourceHandler(javax.faces.application.ResourceHandler wrapped)
wrapped - The resource handler to be wrapped.public boolean isListenerForSource(java.lang.Object source)
UIViewRoot.isListenerForSource in interface javax.faces.event.SystemEventListenerpublic void processEvent(javax.faces.event.SystemEvent event)
throws javax.faces.event.AbortProcessingException
processEvent in interface javax.faces.event.SystemEventListenerjavax.faces.event.AbortProcessingExceptionpublic javax.faces.application.Resource createResource(java.lang.String resourceName,
java.lang.String libraryName)
createResource in class javax.faces.application.ResourceHandlerWrapperpublic void handleResourceRequest(javax.faces.context.FacesContext context)
throws java.io.IOException
handleResourceRequest in class javax.faces.application.ResourceHandlerWrapperjava.io.IOExceptionpublic javax.faces.application.ResourceHandler getWrapped()
getWrapped in interface javax.faces.FacesWrapper<javax.faces.application.ResourceHandler>getWrapped in class javax.faces.application.ResourceHandlerWrapper