-
Notifications
You must be signed in to change notification settings - Fork 3
JavaServer Faces
The story for Java Server Faces (JSF) goes a similar route. The latest specification is JSF 2.2 (JSR-344). The reference implementation is Oracle’s Mojarra. JSF 2.2 is also the standard for Java EE 7 (JSR-342). So choices made.
To compile against the API use below Maven dependency.
<dependency>
<groupId>javax.faces</groupId>
<artifactId>javax.faces-api</artifactId>
<version>2.2</version>
<scope>provided</scope>
</dependency>Again we set it to “provided” to avoid distributing the API on the server as part of the war. Now to be able to run it, we still need to include the libraries in the war for server side deployment.
<dependency>
<!-- This is the Mojarra Implementation of JSF -->
<groupId>org.glassfish</groupId>
<artifactId>javax.faces</artifactId>
<version>2.2.8-02</version>
<scope>runtime</scope>
</dependency>Again, for a fully Java EE 7 compliant server, we would simply not have included this dependency.
With these dependencies added to your web project, you might be able to compile everything, but you won’t be able to do much yet, and might see exceptions. We still need to configure things further to enable CDI and JSF.