Class MinimizedHandler
java.lang.Object
jakarta.faces.application.ResourceHandler
jakarta.faces.application.ResourceHandlerWrapper
org.omnifaces.resourcehandler.DefaultResourceHandler
com.flowlogix.ui.MinimizedHandler
- All Implemented Interfaces:
FacesWrapper<ResourceHandler>
Automatically resolves CSS / JS, etc. resource URLs to there minimized versions in non-development mode.
In its default form, it will resolve my.js into my.min.js or my.css into my.min.css
This works for JSF resource references only, as this is a JSF handler
Works together with Maven minimize plugin, or other build tools what will generate minimized versions of resources. Requires that all resources have their minimized versions generated in production mode, otherwise links will point to files that do not exist.
Example:
faces-config.xml:<application> <resource-handler>com.flowlogix.ui.MinimizedHandler</resource-handler> </application>
web.xml:<!-- Optional, default is "min" --> <context-param> <param-name>com.flowlogix.MINIMIZED_PREFIX</param-name> <param-value>minimized</param-value> </context-param> <!-- Optional, default is "css,js" --> <context-param> <param-name>com.flowlogix.MINIMIZED_FILE_TYPES</param-name> <param-value>css, js, tsx, scss, sass, less</param-value> </context-param>
- Author:
- lprimak
-
Field Summary
Fields inherited from class org.omnifaces.resourcehandler.DefaultResourceHandler
FACES_SCRIPT_RESOURCE_NAME, RES_NOT_FOUND
Fields inherited from class jakarta.faces.application.ResourceHandler
FACES_SCRIPT_LIBRARY_NAME, JSF_SCRIPT_LIBRARY_NAME, JSF_SCRIPT_RESOURCE_NAME, LOCALE_PREFIX, RESOURCE_CONTRACT_XML, RESOURCE_EXCLUDES_DEFAULT_VALUE, RESOURCE_EXCLUDES_PARAM_NAME, RESOURCE_IDENTIFIER, WEBAPP_CONTRACTS_DIRECTORY_PARAM_NAME, WEBAPP_RESOURCES_DIRECTORY_PARAM_NAME
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.omnifaces.resourcehandler.DefaultResourceHandler
createResource, createResource, createResource, createResourceFromLibrary, decorateResource, getLibraryName
Methods inherited from class jakarta.faces.application.ResourceHandlerWrapper
createResourceFromId, createViewResource, getRendererTypeForResourceName, getViewResources, getViewResources, getWrapped, handleResourceRequest, isResourceRendered, isResourceRequest, isResourceURL, libraryExists, markResourceRendered
-
Constructor Details
-
MinimizedHandler
-
-
Method Details
-
decorateResource
- Overrides:
decorateResource
in classDefaultResourceHandler
-