OmniFaces CombinedResourceHandler PF Convenience Classes
See original GitHub issueWe heavily use the Omnifaces CombinedResourceHandler to combine our CSS and JS to just 1 script each in our PrimeFaces apps.
See: https://showcase.omnifaces.org/resourcehandlers/CombinedResourceHandler
However PrimeFaces hard codes some resources in the HeadRenderer which leave it outside the scope of being combined like the theme.css, beanvalidation.js etc etc.
Of course @BalusC has an excellent solution provided on his WIKI here: https://github.com/omnifaces/omnifaces/wiki/Combine-hardcoded-PrimeFaces-resources-using-CombinedResourceHandler
So rather than make people copy and paste and change with every PF version I thought I would include the classes here for PrimeFaces Extensions starting with 10.0.
faces-config.xml
<application>
<system-event-listener>
<system-event-listener-class>org.primefaces.extensions.application.PrimeFacesScriptProcessor</system-event-listener-class>
<system-event-class>javax.faces.event.PostAddToViewEvent</system-event-class>
<source-class>javax.faces.component.UIViewRoot</source-class>
</system-event-listener>
</application>
<lifecycle>
<phase-listener>org.primefaces.extensions.application.PrimeFacesResourceProcessor</phase-listener>
</lifecycle>
Don’t forget to disable PF’s HeadRenderer:
<render-kit>
<renderer>
<component-family>javax.faces.Output</component-family>
<renderer-type>javax.faces.Head</renderer-type>
<renderer-class>com.sun.faces.renderkit.html_basic.HeadRenderer</renderer-class>
</renderer>
</render-kit>
In case you’re using MyFaces, use org.apache.myfaces.renderkit.html.HtmlHeadRenderer as <renderer-class>.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:7 (6 by maintainers)

Top Related StackOverflow Question
Tested this (without CKEditor) and it is working flawlessly in my application. Thanks a lot!
Showcase page added with this commit: https://github.com/primefaces-extensions/primefaces-extensions/commit/abccb3f85d322166f62396e68e15b89dec426e5c