Requirements


BootsFaces is targeted at Java EE 6/7 and requires a Java 1.7 or later VM. The version hosted at Maven Central requires at least Java 8. Versions for Java 7, 9, 10, and 11 are available at the project site.

JSF 2.2 and JSF 2.3 are supported.

BootsFaces supports Oracle Mojarra 2.3+ and Apache MyFaces 2.3+

Attention Some notes:


Download

You have multiple ways to download BootsFaces:


Add these lines to your Maven pom.xml build file:

				         
					

Add these lines to your Gradle build file:

				         
					

Every once in a while, we publish a developer snapshot for testing and preview purposes. Note that these developer previews are not suited for production. In fact, the main purpose of a developer preview is to give the early adopter of the community an option to test and evaluate new features early, and to tell us about bugs. In other words: we know the previews are buggy, and hope there are enthusiasts helping us to polish the software before it hits the market. The great thing is: usually there are daring developers you give the preview version a try and report us back. More often than not, that boils down to being a lot of work for us, but we really appreciate your help. Thanks, early adopters!
Now that you are aware of the risks, add these lines to your Maven pom.xml build file:

				         
					

After that, add the dependency to the new version as shown in the first tab, this time adding the suffix -SNAPSHOT.


If you have not downloaded BootsFaces yet, click here.


Starting a project

Probably the easiest way to get started is to grab one of the demo projects at https://github.com/stephanrauh/BootsFaces-Examples
Alternatively, you can also start from scratch. Open your favorite IDE, start a new project and add the BootsFaces jar you've downloaded to your libraries.
Now, create a new JSF page and make the page header look as follows:


		         
			

Notice the <!DOCTYPE html> declaration, needed because BootsFaces makes use of certain HTML elements and CSS properties that require the use of the HTML5 doctype and the xmlns:b="http://bootsfaces.net/ui" namespace, that enables the use of BootsFaces tags in your JSF page.
You are now ready to develop your project with BootsFaces!
This is a minimal BootsFaces page to get you started:

		         
			

However, we suggest you start reading the Basic Layout page and have a look at the starter template in the Examples section.



Troubleshooting: web.xml and faces-config.xml updated in BootsFaces 0.8.0

Sometimes the CSS and Javascript files aren't loaded automatically. If you happen to run into this error, you have to add a few lines to the faces-config.xml and the web.xml files. Notice that we now recommend to use the CombinedResourceHandler of OmniFaces. In earlier vesions of BootsFaces we'd recommended other things, but this didn't work out.



Keep the URL patterns of your web application as simple as possible. In this case, the resource files are loaded without further ado. Do not use multiple url-patterns.

				         
					

Adding the CombinedResourceHandler of OmniFaces to the faces-config.xml can fix nasty resource loading problems:

				         
					

Theme CSS support revamped in BootsFaces 0.8.0

The BootsFaces_USETHEME context-param in your web.xml controls whether theme.css is loaded or not.

If you set the parameter to false, BootsFaces delivers a CSS file containing the basic layout instructions. This basic file doesn't contain shadows, decorations or colors, so it looks pretty boring. But it's a good starting point to implement your own look and feel.

Setting the parameter to true causes BootsFaces to load theme.css, this is true for Bootstrap and Bootswatch Themes.


		         
			

BootsFaces also contains all 16 BootsWatch themes. You can activate any of these by setting BootsFaces_THEME to the name of the theme:

		         
			

If you need more customization you can use the custom value.

Please refer to the Themes page for instructions on Custom Theme.



Building the BootsFaces.jar from source revamped in BootsFaces 0.8.0

Most of the time you're probably happy with the binaries available at Maven Central or at the download page. However, it's also possible to build BootsFaces from source. This way, you get our latest bug fixes and the newest components, and you can also contribute bug fixes or components yourself to the project. (Truth to tell you get also our newest bugs. Use at own risk).

The BootsFaces source code is hosted on a GitHub repository. Clone the repository using git (or download the zip file and unpack it to a folder). This folder contains two build files: a Maven pom.xml and an Gradle build.gradle. In fact, there are even two Gradle files: the subfolder gradleResources contains a Gradle build file of its own, which is called by the Gradle build file of the parent project.

The Maven build file is the quick-and-easy solution for most developers. However, it depends on the results of the Gradle build. When the BootsFaces team (or a committer sending us a pull request) changes one of the CSS or JavaScript files, they have to run the Gradle build first. The Gradle build prepares the resources for Maven, which are committed to GitHub. That way, the Maven build is always up-to-date, even if it lacks important parts of the build process.

Cutting a long story short, you're free to use either the Maven or the Gradle build, unless you want to modify the CSS or JavaScript files of BootsFaces.

 The Maven build


To build the jar, run mvn clean install on the command line. Most IDEs also offer decent support for Maven. For instance, Eclipse users can import the project via "Import --> Maven --> Existing Maven project".

 The Gradle build from Command Line


Building BootsFaces with Gradle is very straightforward, the only prerequisite is having java installed (JDK 7 or later),
there is no need to have Gradle installed, thanks to the Gradle wrapper.
Just change your directory to the root directory of the project and execute:
./gradlew
on *NIX systems or
gradlew.bat
on Windows systems.
After few seconds you should see the "BUILD SUCCESSFUL" message .
The default Gradle build defaults to a conservative Java 6 target, therefore you will find the built library in the subdirectory java6/build/libs .
You can configure your preferred target JVM version in the build.properties file, where you can also configure the compilation arguments for every target.
You can run the build for multiple targets at a time, in this case you will find the built library in the corresponding path:
java6/build/libs for Java 6,
java7/build/libs for Java 7,
java8/build/libs for Java 8.

 The Gradle build in your IDE


Import the Gradle project into your IDE. Whether you import the subproject or not, is up to you. You don't need it. To build the project, first run Gradle with the target buildResources (which is inherited from the subproject). After that, run "Gradle assemble" to build the BootsFaces-OSP.jar. You find the jar file in the build folder of your project.



Customization of the BootsFaces.jar

The script build default is to build the library with the Bootstrap styles and all Bootswatch themes, but you can control what themes you want included setting the bootswatch.theme property in the build.properties file.

You can also customize the look and feel taking advantage of the build system. There are many Bootstrap customizers on the net other than Bootswatch. What you need is a file with the variables to customize the build. Some customizers will provide you a .less file as well.
Put the files in the gradleResources/less directory of the build and tweak the bs-* files to use your variables / .less file.



Roadmap 0.9 → 1.0 → 1.1

The big tickets of the next versions are:


Minor (but still important) tickets are
In any case, we'd like to hear from you. Use the bug tracker to inform us about bugs you've discovered, components you'd like to see or contributions you'd like to make. Your feedback is welcome!