created on | October 10, 2023 |
Jakarta Faces 3.0 didn’t bring any new features or changes, but was just a renaming of the javax.faces namespace to the jakarta.faces namespace. So I did the migration straight from Java Server Faces 2.3 to Jakarta Faces 4.0.
Change all imports of javax.faces to jakarta.faces.
The namespace of the taglib UIRs http://xmlns.jcp.org/jsf/* has been renamed to the URNs jakarta.faces.*. This is less confusing, because there were no XSDs behind the URLs anyway.
http://xmlns.jcp.org/jsp/jstl/* has been renamed to jakarta.tags.*.
Check that all Facelet templates and Facelets use the new URNs.
In JSF 2.3 Faces-specific CDI initialization was activated with
In Jakarta Faces 4.0, the parameter FacesConfig.Version is deprecated.
There is a new feature called extensionless mapping which allows to omit the file suffix when requesting a Jakarta Faces page, i.e. instead of http://idoru/login.xhtml you can use http://idoru/login with extensionless mapping.
The context configuration parameter for extensionless mapping didn’t make it into the Jakarta Faces 4.0 Specification Documentation, so I am listing the syntax here:
Since version 10.0.0, Primefaces comes in two kinds: one using javax.* dependencies, one using the jakarta.* dependencies. For Jakarta EE you need the classifier jakarta in the maven coordinates for the Primefaces dependency:
Without the jakarta classifier, you’ll get javax.* kind. Using that in Jakarta EE will result in the java.lang.NoClassDefFoundError: javax/servlet/ServletRequestListener, which hit me when I fired up Payara Micro 6 with Primefaces 13 for the first time:
github jakartaee/faces, Faces 4.0: rename xmlns.jcp.org taglib URIs #1553
github jakartaee/faces, Faces 4.0: Provide extensionless mapping #1508
github jakartaee/faces, Faces 4.0: deprecate FacesConfig.Version #1594
github eclipse-ee4j/mojarra Deprecate @FacesConfig.Version #5017
Primefaces Documentation v10.0.0, Download, Download with Maven