skip to navigation
skip to content

Planet Jython

Last update: February 01, 2015 01:37 PM

January 25, 2015


Josh Juneau

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

**Updated on 01/25/2015:
The features that have been added since 11/4/2014 are as follows:

- Utilize a CDI managed validator:

  @FacesValidator(value = "myValidator", managed = true)
  public class MyValidator implements Validator {

     @Inject
     MyModel model;
    ..

  }

- Utilize a CDI managed converter:

  @FacesConverter(value = "myConverter", managed = true)
  public class MyConverter implements Converter {
    ..
  }


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.

* Be sure to test against one of the milestone releases before placing JIRA issues.

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

January 25, 2015 08:03 AM

January 23, 2015


Josh Juneau

Adopt-a-JSR for Java EE - CJUG Meetup Recap

This fall, the Chicago Java User Group (CJUG) adopted JSR-366, the Java Platform, Enterprise Edition (Java EE 8) Specification.  To that end, the CJUG will be hosting periodic meetups to work on contributing towards Java EE 8.  Our first meet with regards to this agenda was held on January 15, and we covered JSF 2.3 (JSR-372)...for beginners and advanced users.  This meetup was geared towards anyone who wanted to contribute to Java EE 8 in some way, and we hosted two tracks during the meetup:  "I Want to Learn JSF", and "I Want to Hack JSF"...beginner and advanced, respectively.  Both of the tracks were well received.

I Want to Learn JSF Recap:  

Bob Paulin, CJUG President, led the group through a tutorial that focused on building a simple JSF application using the NetBeans 8 IDE.  Specifically, this tutorial led the group to building entity classes against some of the sample database tables, creating EJBs, and finally, generating JSF views to work with the data.  The tutorial can be found here if you are interested in taking a look.  The sources for the basic tutorial are in GitHub.

I Want to Hack JSF Recap:

I led the more advanced JSF track through a series of advanced tasks...digging into the Mojarra code a bit.  First, we covered the basic steps to checkout the Mojarra 2.3 Milestone and trunk.  We then covered the build process, and how to pull the sources into an IDE, such as NetBeans.  Finally, we decided to dig into the code a bit and try to debug an existing JIRA issue, JAVASERVERFACES-3429.  The team worked the issue, loading the test project into NetBeans and using the debugger to step through the code.  We were able to reproduce the issue and pinpoint the cause of the problem to a specific method within the Mojarra sources.  We were unable to determine the exact cause of the issue due to time constraints, but the group gained useful experience digging through the Mojarra sources.

The evening was a success, as we were able to spread information on how anyone can contribute to Java EE, even those who are new to the platform.  We also sparked new interest in JSF, and presented some of the upcoming JSF 2.3 features.

Contributing

What are some of the ways you can contribute?  How about the following, just to list a few:

  1)  Read through the documentation/specification and provide feedback.

  2)  Provide documentation for a specific JSR...perhaps work on the release notes for a particular milestone, write examples, or do a presentation.

  3)  Test against the milestone releases, and submit issues if any are found.

Again, this is just a short list of how anyone can get started contributing.  I am looking forward to the next Adopt-a-JSR meetup for CJUG, and I look forward to hearing about your JUG's contribution towards making Java EE 8 great!

January 23, 2015 11:56 PM