Dealing with resource files improved in 0.8.0

The BootsFaces jar contains many CSS and JavaScript files. You don't need external resource files to use BootsFaces. However, many developers and web designers aren't happy with that. These are basically the reasons for using external resources:

To serve all these requirements, we've implemented quite a few options to influence which files are loaded and which are not.

jQuery and jQueryUI

In general, BootsFaces goes into some lengths to decide which libraries to load, and when. Among other things, BootsFaces modifies the order of JavaScript libraries if need be:

If you provide your own version of jQuery (i.e. if there's a <h:outputScript library="(whatever)" name="(whatever)/jQuery-(whatever).js" />), BootsFaces doesn't add its own jQuery. Its up to you to make sure your jQuery is compatible to BootsFaces. Our mechanism to detect whether you add jQuery or not is fairly flexible. It checks whether the resource name contains the substring "jquery" and ends with ".js". Plus, it's case-agnostic.

The some applies to jQueryUI. In this case, we check for the sub-string "jquery-ui".

Font Awesome

If you provide your own version of FontAwesome, BootsFaces doesn't load its own version of FontAwesome. We're looking for resource files containing the sub-string "font-awesome" or "fontawesome" and ending with ".css". Again, we ignore the case.

You can suppress Font Awesome on a per-page basis by adding the facet "no-fa" to the <h:head /> of your XHTML file.

Configuring resources via the web.xml

Alternatively, you can configure your web.xml to suppress certain resources:

Defining when your resource files are loaded

If you need to place your CSS or JS file before or after the other resource files, you can use the attribute position of the <h:outputStylesheet />. This is a non-standard attribute, so chances are your IDE complains about it. If so, make it a pass-through attribute.