Class MinimizedHandler

All Implemented Interfaces:
FacesWrapper<ResourceHandler>

public class MinimizedHandler extends DefaultResourceHandler
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