Skip to content
This repository has been archived by the owner on Nov 23, 2020. It is now read-only.
/ jsf-utils Public archive

Some helper and utilities for JSF

Notifications You must be signed in to change notification settings

dhs3000/jsf-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 

Repository files navigation

jsf-utils

Provides some utilities for JSF.

  • Post-processing js / css (less) files registered at the view root.
  • CDI-Extension to mark beans for eager initializing

Post-processing the View Root

The post-processor modifies all referenced stylesheet and script resources of the view root. The resources are collected into one file per type.

For the stylesheets (referenced by <h:outputStylesheet />) it enables the usage of LESS (instead of pure CSS). All stylesheets are collected into one file and afterwards compiled with the less compiler so that variable declarions etc. defined in different files could be used everywhere.

Also the stylesheet is normalized and all background images are inlined into the stylesheet with the help of data URIs.

All scripts (referenced by <h:outputScript />) are collected into one single file and compiled by the Google Closure Compiler to remove unnecessary code etc.

The post-prcessor has to be configured on the faces-config.xml as follows:

<system-event-listener>
    <system-event-listener-class>de.dennishoersch.web.jsf.resources.PostProcessResourcesPreRenderListener</system-event-listener-class>
    <system-event-class>javax.faces.event.PreRenderComponentEvent</system-event-class>
</system-event-listener>

About

Some helper and utilities for JSF

Resources

Stars

Watchers

Forks

Languages