Quarkus PrimeFaces

A Quarkus extension that lets you utilize PrimeFaces and PrimeFaces Extensions make JSF development so much easier!

Installation

If you want to use this extension, you need to add the io.quarkiverse.primefaces:quarkus-primefaces extension first to your build file.

For instance, with Maven, add the following dependency to your POM file:

<dependency>
    <groupId>io.quarkiverse.primefaces</groupId>
    <artifactId>quarkus-primefaces</artifactId>
    <version>4.16.0</version>
</dependency>
<dependency>
    <groupId>io.quarkiverse.primefaces</groupId>
    <artifactId>quarkus-primefaces-extensions</artifactId>
    <version>4.16.0</version>
</dependency>

Getting Started

The extension ships a Codestart that scaffolds a runnable Faces application, so you do not have to write web.xml and faces-config.xml by hand.

Using the Quarkus CLI:

quarkus create app org.acme:primefaces-app --extension=io.quarkiverse.primefaces:quarkus-primefaces:4.16.0

Or with Maven:

mvn io.quarkus.platform:quarkus-maven-plugin:create \
    -DprojectGroupId=org.acme -DprojectArtifactId=primefaces-app \
    -Dextensions=io.quarkiverse.primefaces:quarkus-primefaces:4.16.0

The generated project contains:

File Purpose

src/main/resources/META-INF/web.xml

Faces servlet mapping, welcome file, error pages and sensible PrimeFaces/MyFaces context parameters, including primefaces.THEME.

src/main/resources/META-INF/faces-config.xml

The PrimeFaces Dialog Framework, exception handler factory and client window factory.

src/main/resources/META-INF/resources/index.xhtml

A sample page with a form, a p:growl and a p:dataTable.

src/main/resources/META-INF/resources/template/layout.xhtml

The Facelets template shared by index.xhtml, error.xhtml and viewExpired.xhtml.

src/main/java/org/acme/GreetingBean.java

A @Named @ViewScoped backing bean for the sample page.

A Quarkus application is packaged as a jar and not a war, so the descriptors live under META-INF rather than WEB-INF.

Start it with quarkus dev and browse to http://localhost:8080/index.xhtml.

Only quarkus-primefaces provides a Codestart. Adding quarkus-primefaces-extensions to the same command will not generate a second, conflicting set of descriptors.

Limitations

When creating a GraalVM Native image you may need to change some of your code to be native friendly and some features may not be available to use in Native mode.

FeedReader not supported. Rome library uses JDOM XML parsing and we did not spend the time to investigate for a lightly used component.
EL expressions which use reflection may run into issues with things like List size() or Enum name() as they are not bean compliant method names. You might need to change your EL expression or add helper code to achieve what you want.

Versioning

The versioning of this extension will follow the pattern [quarkus.version].[primefaces.version].[patch]. For example:

Version Explanation

2.12.1

Quarkus 2 (EE8), PrimeFaces 12, Revision 1

3.12.0

Quarkus 3 (EEE10), PrimeFaces 12, Revision 0