Skip to content

A JSF HTML Compression implementation that is designed to remove white spaces (minify) HTML, CSS, and JS.

License

Notifications You must be signed in to change notification settings

bluelotussoftware/jsf-html-compressor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsf-html-compressor

A JSF HTML Compression implementation that is designed to remove white spaces (minify) HTML, CSS, and JS.

NOTE: The compressor does not handle AJAX (<partial-response>). If you want to handle AJAX take a look at whitespace-filter, or fork this code and implement something similar.

Requirements

I used the last version of htmlcompressor to build the project. The latest version is 1.5.3. You will need to install it in your local Maven repository since it is not in the public repositories.

jar

mvn deploy:deploy-file -DgroupId=com.googlecode.htmlcompressor \
-DartifactId=htmlcompressor -Dversion=1.5.3 \
-Dfile=htmlcompressor-1.5.3.jar \
-Dpackaging=jar \
-Durl=file:///PATH_TO_LOCAL_REPOSITORY/.m2/repository

sources

mvn deploy:deploy-file -DgroupId=com.googlecode.htmlcompressor \
-DartifactId=htmlcompressor -Dversion=1.5.3 \
-Dfile=htmlcompressor-1.5.3-sources.jar \
-Dpackaging=jar \
-Durl=file:///PATH_TO_LOCAL_REPOSITORY/.m2/repository \
-Dclassifier=sources

javadocs

mvn deploy:deploy-file -DgroupId=com.googlecode.htmlcompressor \
-DartifactId=htmlcompressor -Dversion=1.5.3 \
-Dfile=htmlcompressor-1.5.3-javadoc.jar \
-Dpackaging=jar \
-Durl=file:///PATH_TO_LOCAL_REPOSITORY/.m2/repository \
-Dclassifier=javadoc

Maven Dependency

<dependency>
    <groupId>com.googlecode.htmlcompressor</groupId>
    <artifactId>htmlcompressor</artifactId>
    <version>1.5.3</version>
</dependency>

Usage

This filter is an automatic filter based on its annotations, you simply need to add it to your project.

<dependency>
    <groupId>com.bluelotussoftware</groupId>
    <artifactId>jsf-html-compressor</artifactId>
    <version>1.0.0</version>
</dependency>

Create a faces-config.xml, or modify an existing file to contain the following entry.

<?xml version='1.0' encoding='UTF-8'?>
<faces-config version="2.2"
              xmlns="http://xmlns.jcp.org/xml/ns/javaee"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd">
    <factory>
        <render-kit-factory>com.bluelotussofware.jsf.faces.render.HtmlCompressorRenderKitFactory</render-kit-factory>
    </factory>
</faces-config>

About

A JSF HTML Compression implementation that is designed to remove white spaces (minify) HTML, CSS, and JS.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages