Java HTML FreeMarker Other
Clone or download
persapiens Merge pull request #214 from persapiens/master
adding jaxb-core to run with java 10 and myfaces
Latest commit 76e07fe Aug 1, 2018

JoinFaces Example

Heroku Build Status Codecov Coverage Status Dependency Status License

This SAP (Single Page Application) illustrates JSF usage inside JAR packaged Spring Boot Application.

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

See Example Application in the cloud

1- Access starter.jsf page at This page can help you to choose the JSF Spring Boot Starter that fits your needs. You may login with credentials

User Password Roles
persapiens 123 ROLE_ADMIN
nyilmaz qwe ROLE_USER

Run Example Application locally

1- Clone this project

git clone

2- Build

mvn clean install

3- Run

java -jar target/joinfaces-example-3.2.4-SNAPSHOT.jar

4- Access starter page at http://localhost:8080/index.jsf

Key Files


Includes joinfaces starter dependency. All other jsf dependencies are included transitively.



If you prefer Jetty instead of Tomcat, exclude tomcat-spring-boot-starter artifactId and add jetty-spring-boot-starter in order to use Jetty servlet container.

If you prefer Undertow instead of Tomcat, exclude tomcat-spring-boot-starter artifactId and add undertow-spring-boot-starter in order to use Undertow servlet container.

If you prefer MyFaces instead of Mojarra, exclude mojarra-spring-boot-starter artifactId and add myfaces-spring-boot-starter in order to use MyFaces JSF Implementation.

If you prefer PrimeFaces, add primefaces-spring-boot-starter in order to use PrimeFaces JSF Components.

If you prefer BootsFaces, add bootsfaces-spring-boot-starter in order to use BootsFaces JSF Components.

If you prefer ButterFaces, add butterfaces-spring-boot-starter in order to use ButterFaces JSF Components.

If you prefer AngularFaces, add angularfaces-spring-boot-starter in order to use AngularFaces JSF Components.

If you prefer RichFaces, add richfaces-spring-boot-starter in order to use RichFaces JSF Components.

Note that spring-boot-starter-security is included to secure the application.



Configure jsf.PROJECT_STATE and jsf.primefaces.THEME properties.

  PROJECT_STAGE: Development
    theme: overcast


Example page to help you choose the right JSF Spring Boot Starter for you.

Note that xhtml, js, css and images files should be located at src/main/resources/META-INF/resources directory to JSF use them.

Look at authorize and anonymous jsf spring security facelet tags in action to secure page information.

  <sec:authorize access="hasRole('ROLE_ADMIN')">
    <p:panelGrid columns="1" rendered="#{sec:isFullyAuthenticated()}">
      <p:link title="Logout" href="/logout">
        <p:outputLabel value="You are logged in as an ADMIN" />


Very simple spring main application. Only SpringBootApplication annotation is required.

public class JoinFacesExampleApplication {


Spring Security configuration class to secure authentication with credentials to persapiens and nyilmaz users.


Managed bean using ViewScoped CDI annotation. The equivalent spring scope of ViewScoped annotation is configured automatically by Jsf Spring Boot Starter.

public class StarterMBean {

Getting Help