[JAVA] How to install Boots Faces

I want to use BootStrap in JSF

When developing a small web system, BootStrap is often used regardless of the language. So, I would like to use BootStrap even in a JSF + PrimeFaces environment, but if I thought that using it as it is would probably conflict, I found something called BootsFaces, so I will write down how to install it.

Introduce Boots Faces

Install the library with Maven

Add the following to pom. For reference, the dependency element of primefaces is also listed.

pom.xml


<dependency>
    <groupId>net.bootsfaces</groupId>
    <artifactId>bootsfaces</artifactId>
    <version>1.0.1</version>
    <scope>compile</scope>
</dependency>
<dependency>
    <groupId>org.primefaces</groupId>
    <artifactId>primefaces</artifactId>
    <version>6.0</version>
    <scope>compile</scope>
</dependency>

Hello,BootsFaces Create the following xhtml file to do "Hello, World" in BootsFaces. At this time, in the namespace

xmlns:b="http://bootsfaces.net/ui"

Will be added. See here for available components and usage. For the time being, check the operation using the PrimeFaces tag as well.

hello_bootsfaces.xhtml


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:b="http://bootsfaces.net/ui">
<h:head>
	<title>Hello,BootsFaces</title>
</h:head>
<h:body>
	<b:container>
		<b:row>
			<b:column>
				<h1>Hello,BootsFaces!</h1>
			</b:column>
		</b:row>
		<b:row>
			<b:column>
				<p:spinner />
			</b:column>
		</b:row>
	</b:container>
</h:body>
</html>

Change the theme of BootStrap

Since it's a big deal, I'll change the theme of BootStrap. It seems that the theme of Bootswatch can be used, so specify the theme to be used in web.xml.

web.xml


<context-param>
	<param-name>BootsFaces_THEME</param-name>
	<param-value>cyborg</param-value>
</context-param>

Done

This completes the installation of BootsFaces. Access the sample screen and check that Hello, World is created.

WS000046.JPG

Recommended Posts

How to install Boots Faces
How to install Docker
How to install docker-machine
How to install MySQL
How to install ngrok
[Rails] How to install devise
[Rails] How to install simple_calendar
[Rails] How to install reCAPTCHA
How to install JDK8-10 (Mac)
[Rails] How to install Font Awesome
How to install JMeter for Mac
How to install ImageMagick on Windows 10
How to install ruby through rbenv
[How to install Spring Data Jpa]
Super rough! How to install Dagger2
How to install Bootstrap in Ruby
How to install MariaDB 10.4 on CentOS 8
[Rails] How to install ImageMagick (RMajick)
[Rails] How to install Font Awesome
How to install WildFly on Ubuntu 18.04
How to install Swiper in Rails
How to install Play Framework 2.6 for Mac
How to install Eclipse (Photon) on Mac
How to install production Metabase on Ubuntu
How to deploy
How to install beta php8.0 on CentOS8
How to install the legacy version [Java]
How to install kafkacat on Amazon Linux2
How to install network drivers on standalone Ubuntu
How to install Titan2D (v4.2.0) in virtual environment
How to install multiple JDKs on Ubuntu 18.04 LTS
How to Install Oracle JDK 1.8 in Ubuntu 18.04 LTS?
[Ruby on Rails] How to install Bootstrap in Rails
How to develop OpenSPIFe
How to call AmazonSQSAsync
How to use Map
How to write Rails
How to use with_option
How to use fields_for
How to use java.util.logging
How to use map
How to use collection_select
How to adapt Bootstrap
How to use Twitter4J
How to use active_hash! !!
How to use MapStruct
How to use TreeSet
How to write dockerfile
How to uninstall Rails
[How to use label]
How to make shaded-jar
How to write docker-compose
How to use identity
How to use hashes
How to write Mockito
How to create docker-compose
How to use JUnit 5
How to write migrationfile
How to build android-midi-lib
How to use Dozer.mapper
How to use Gradle