Integration with OmniFaces

BootsFaces loads many small CSS and JavaScript files. So it's a good idea to combine it with OmniFaces. In particular, we recommend to use the CombinedResourceHandler. It solves a couple of weird problems. For example, Glyphicon icons typically weren't displayed correctly without the CombinedResourceHandler until version 0.8.1 .

Note that we didn't run an exhaustive compatibility test yet. However, nobody's ever reported us problems with BootsFaces and OmniFaces.

Add these lines to your Maven pom.xml file:

To activate the CombinedResourceHandler, add a <resource-handler> to the faces-config.xml file:

Caching version of the CombinedResourceHandler

Caching can add a lot to your page's responsiveness. We've submitted a pull request to OmniFaces that adds caching to the CombinedResourceHandler. If you happen to use version 2.0 or earlier of OmniFaces, you can add caching yourself by adding a couple of classes to your application's class path. You also have to add a few lines to the web.xml file to activate and configure caching.

Note that by adding the classes you overwrite classes contained in the OmniFaces.jar. This trick relies on the correct working of the classloader. According to the documentation, Tomcat is garanteed to support this (at least in the default configuration). But in the general case, we can't guarantee for anything. Use at own risk.

Download the PrimeFaces Bootsstrap theme, add it to your application's lib folder and activate it in the web.xml like so:
As mentioned above, you only have to add these classes if you use OmniFaces 2.0 or below.
CombinedResourceInputStream
CacheEntry
CacheFactory
CacheInstancePerScopeProvider
CacheProvider
DefaultCache
DefaultCacheProvider
TimeToLiveCache

Warnings caused by the CombinedResourceHandler

If you use an older version of OmniFaces, Mojarra 2.2 generates a lot of warnings on the console in developer mode:

These warnings are caused by OmniFaces removing the original resources. Mojarra detects there's something missing and complains about it. You can safely ignore these warnings. Also see the corresponding issue on the OmniFaces bugtracker for details.

This nuisance has been fixed with OmniFaces 1.12 and 2.2.