/joinfaces

JoinFaces: JSF Spring Boot Starters - JSF inside JAR packaged Spring Boot Application

Primary LanguageJavaApache License 2.0Apache-2.0

JoinFaces

Maven Central Build Status Coverage Status Dependency Status Javadocs License

This project enables JSF usage inside JAR packaged Spring Boot Application.

It autoconfigures PrimeFaces, PrimeFaces Extensions, BootsFaces, ButterFaces, OmniFaces, AngularFaces, Mojarra and MyFaces libraries to run at embedded Tomcat, Jetty or Undertow servlet containers.

It also aims to solve JSF and Spring Boot integration features. Current version includes JSF and CDI annotations support and Spring Security JSF Facelet Tag support.

How to use

JoinFaces Example shows JSF Spring Boot Starter usage. It may help you to choose the JSF Spring Boot Starter that fits your needs.

You can find more examples here.

Key Features

Eighteen JSF Spring Boot Starters available

Starter Servlet Container JSF Implementation JSF Libraries
jsf-spring-boot-starter Tomcat Mojarra PrimeFaces 6.0, PrimeFaces Extensions 6.0.0
jsf-bootsfaces-spring-boot-starter Tomcat Mojarra BootsFaces 0.9.1, AngularFaces 2.1.3, PrimeFaces 6.0, PrimeFaces Extensions 6.0.0
jsf-butterfaces-spring-boot-starter Tomcat Mojarra ButterFaces 2.1.9, BootsFaces 0.9.1, PrimeFaces 6.0, PrimeFaces Extensions 6.0.0
jsf-myfaces-spring-boot-starter Tomcat MyFaces PrimeFaces 6.0, PrimeFaces Extensions 6.0.0
jsf-myfaces-bootsfaces-spring-boot-starter Tomcat MyFaces BootsFaces 0.9.1, AngularFaces 2.1.3, PrimeFaces 6.0, PrimeFaces Extensions 6.0.0
jsf-myfaces-butterfaces-spring-boot-starter Tomcat MyFaces ButterFaces 2.1.9, BootsFaces 0.9.1, PrimeFaces 6.0, PrimeFaces Extensions 6.0.0
jsf-jetty-spring-boot-starter Jetty Mojarra PrimeFaces 6.0, PrimeFaces Extensions 6.0.0
jsf-jetty-bootsfaces-spring-boot-starter Jetty Mojarra BootsFaces 0.9.1, AngularFaces 2.1.3, PrimeFaces 6.0, PrimeFaces Extensions 6.0.0
jsf-jetty-butterfaces-spring-boot-starter Jetty Mojarra ButterFaces 2.1.9, BootsFaces 0.9.1, PrimeFaces 6.0, PrimeFaces Extensions 6.0.0
jsf-jetty-myfaces-spring-boot-starter Jetty MyFaces PrimeFaces 6.0, PrimeFaces Extensions 6.0.0
jsf-jetty-myfaces-bootsfaces-spring-boot-starter Jetty MyFaces BootsFaces 0.9.1, AngularFaces 2.1.3, PrimeFaces 6.0, PrimeFaces Extensions 6.0.0
jsf-jetty-myfaces-butterfaces-spring-boot-starter Jetty MyFaces ButterFaces 2.1.9, BootsFaces 0.9.1, PrimeFaces 6.0, PrimeFaces Extensions 6.0.0
jsf-undertow-spring-boot-starter Undertow Mojarra PrimeFaces 6.0, PrimeFaces Extensions 6.0.0
jsf-undertow-bootsfaces-spring-boot-starter Undertow Mojarra BootsFaces 0.9.1, AngularFaces 2.1.3, PrimeFaces 6.0, PrimeFaces Extensions 6.0.0
jsf-undertow-butterfaces-spring-boot-starter Undertow Mojarra ButterFaces 2.1.9, BootsFaces 0.9.1, PrimeFaces 6.0, PrimeFaces Extensions 6.0.0
jsf-undertow-myfaces-spring-boot-starter Undertow MyFaces PrimeFaces 6.0, PrimeFaces Extensions 6.0.0
jsf-undertow-myfaces-bootsfaces-spring-boot-starter Undertow MyFaces BootsFaces 0.9.1, AngularFaces 2.1.3, [PrimeFaces 6.0] (http://primefaces.org), PrimeFaces Extensions 6.0.0
jsf-undertow-myfaces-bootsfaces-spring-boot-starter Undertow MyFaces ButterFaces 2.1.9, BootsFaces 0.9.1, [PrimeFaces 6.0] (http://primefaces.org), PrimeFaces Extensions 6.0.0

Note that all starters include the following libraries

Library Dependency Description
primefaces-all-themes 1.0.8 Themes for primefaces
omnifaces 1.14 Utility library for JSF 2
cdi-api 1.2 Api of CDI (Contexts and Dependency Injection)

JSF properties configuration via application.properties or application.yml

Library Namespace Example
standard (javax.faces) jsf jsf.PROJECT_STAGE: Development
primefaces jsf.primefaces jsf.primefaces.theme: overcast
bootsfaces jsf.bootsfaces jsf.bootsfaces.USETHEME: true
butterfaces jsf.butterfaces jsf.butterfaces.provideJQuery: true
omnifaces jsf.omnifaces jsf.omnifaces.FACES_VIEWS_ENABLED: true
angularfaces jsf.angularfaces jsf.angularfaces.addLabels: true
mojarra jsf.mojarra jsf.mojarra.preferXHTML: true
myfaces jsf.myfaces jsf.myfaces.PRETTY_HTML: true
jetty jsf.jetty jsf.jetty.classPathResource: META-INF/resources
undertow jsf.undertow jsf.undertow.classPathResource: META-INF/resources

Look full application.yml example.

Additional information in #22

JSF and CDI annotations support automatically

Annotation | ------- | ---- @NoneScoped | @RequestScoped | @ViewScoped | @SessionScoped | @ApplicationScoped |

Spring Security JSF Facelet Tag support

Namespace: http://www.springframework.org/security/tags

Tag Description
authorize perform Spring Security authorization decisions, using attributes: ifAnyGranted, ifAllGranted, ifNotGranted, access, url, method, var.
anonymous verify if the user is anonymous.
authenticated verify if the user is not anonymous.
fullyAuthenticated verify if the is not an anonymous or a remember-me user.
Function Description
areAllGranted returns true if the user has all of of the given authorities.
areAnyGranted returns true if the user has any of the given authorities.
areNotGranted returns true if the user does not have any of the given authorities.
isAllowed returns true if the user is allowed to access the given URL and HTTP method combination.
isAnonymous returns true if user is anonymous.
isAuthenticated returns true if the user is not anonymous.
isFullyAuthenticated returns true if the is not an anonymous or a remember-me user.

Additional information in #29

System Requirements

By default, JSF Spring Boot Starter requires Java 7 and Spring Boot 1.4.0 or above.

Additionnal information here.

Getting Help

Contributing

Structure

This software is multi module Maven project and follows Spring Boot Reference to create JSF Auto Configuration. See what's inside each submodule.