Enterprise Java

Building and Testing JSF.next

The JSF 2.3 Expert Group is hard at work determining which features will be part of the upcoming release.  The JSF Team been working hard improving CDI alignment, among other things.  There are already a number of new features in the JSF 2.3 codebase that you can begin to test. I will attempt to keep this post updated with the latest features that have been added.  For the most up-to-date reference, please see Manfred’s blog.  To reference the information from Manfred’s blog, take a look here.

 
 
 
 

JSF 2.3 Features

The features that have been added as of 11/4/2014 are as follows:

- Inject @ViewMap
@ViewMap
@Inject
Map viewMap;
- #1333 - Support @Inject for UIViewRoot

@Inject
UIViewRoot viewRoot;
- #1332 - Let CDI handle #{view}

- #1331 - Let CDI handle #{application}

- #1254 - contracts attribute too restrictive.

- #1328 - Let CDI handle #{session} EL resolving

- #1325 - Let CDI handle #{applicationScope}

- #1311 - Let CDI handle #{facesContext} EL resolving

- #1323 - Support @Inject for the applicationMap

@ApplicationMap
@Inject
Map applicationMap;
- #1322 - Simplify #{externalContext} to use ExternalContextProducer

- #1309 - Support @Inject for ExternalContext

@Inject ExternalContext externalContext;
- #527 - Support @Inject for FacesContext

@Inject FacesContext facesContext;

Please reference the JavaServer Faces JIRA for more information.

Taking JSF 2.3 for a Test Spin

If you would like to start testing out these new features today, the easiest way to get started is to simply download the 2.3 SNAPSHOT and then replace the javax.faces.jar file within your GlassFish/glassfish/modules directory with the snapshot.

You will need to be sure to reference version 2.3 in your faces-config.xml. as follows:

<faces-config  version="2.3"
              xmlns="http://xmlns.jcp.org/xml/ns/javaee"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_3.xsd">

</faces-config>

If you are adventurous and you would like to build JSF from source, that is also fairly simple.  To do so, follow these steps:

  1. Check out the trunk using SVN:

    svn checkout –username yourname –password x https://svn.java.net/svn/mojarra~svn/trunk

  2. Copy the build.properties.glassfish file to build.properties
  3. Edit the build.properties file and set jsf.build.home to your source home.
  4. From the source home, run ant clean main

The jsf-api.jar will be in SOURCE_HOME/jsf-api/build/lib and jsf-impl.jar will be in SOURCE_HOME/jsf-ri/build/lib.

For more information on building the sources (and even contributing), please see the following reference: https://wikis.oracle.com/display/GlassFish/JavaServerFacesRI#JavaServerFacesRI-HowcanIcontribute%3F

Josh Juneau

Josh is an application developer and technical writer. He has authored several books for Apress, primarily focusing on Java development. Most recently, he has authored Java EE 7 Recipes, Introducing Java EE 7, and Java 8 Recipes. Josh is a member of the JCP, and he is on the JSF 2.3 Expert Group.
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Back to top button