In this post of the series on JSF 2.2 I will show the new XML namespaces used by JSF 2.2 for faces-config.xml , custom tag lib config files and JSF taglibs. Basically, all namespaces start with http://xmlns.jcp.org now instead of http://java.sun.com . So one more remnant of the Sun era that was removed.

Like many versions of JSF before, JSF 2.2 defines new versions of the schemas for the faces-config.xml and custom tag lib config files. But this time the complete namespace is changed from http://java.sun.com/xml/ns/javaee to http://xmlns.jcp.org/xml/ns/javaee additionally for all schemas. This applies for all parts of Java EE 7 by the way.

The following listing shows a JSF 2.2 faces-config.xml :

The following listing shows a JSF 2.2 taglib config file:

Beside the config file schemas, JSF 2.2 also changes the namespaces for all JSF taglibs. Good news, everyone! The old taglib namespaces are still supported in case you are planning to migrate an existing application. The following table shows the old and new namespaces for the most important JSF taglibs.

Old namespace JSF 2.2 namespace http://java.sun.com/jsf/core http://xmlns.jcp.org/jsf/core http://java.sun.com/jsf/html http://xmlns.jcp.org/jsf/html http://java.sun.com/jsf/facelets http://xmlns.jcp.org/jsf/facelets http://java.sun.com/jsf/composite http://xmlns.jcp.org/jsf/composite http://java.sun.com/jsp/jstl/core http://xmlns.jcp.org/jsp/jstl/core http://java.sun.com/jsp/jstl/functions http://xmlns.jcp.org/jsp/jstl/functions

You can see the root element of a Facelets view with some new JSF 2.2 namespaces in the next listing. It includes the Core Taglib, the HTML Taglib and a custom composite component taglib.

The examples for the JSF 2.2 series in the JSFlive Github repository jsf22-examples contain various examples for the new namespaces.

Further official details about JSF 2.2 can be found in the JSR 344: JavaServer Faces 2.2.

Update:

There used to be a bug in Mojarra before version 2.2.1 which prevented the new taglib namespaces from working for for all tags (see JAVASERVERFACES-2868 for details). With Mojarra 2.2.1 this bug was fixed.