Stable Release in branch 2.0
2.0.9-08
Released 12 May 2018
(8 years ago)
SoftwareJSF/Jakarta Faces
Version2.0
RequirementJava EE 6
Initial release2.0.0
03 Aug 2011
(15 years ago)
Latest release2.0.9-08
12 May 2018
(8 years ago)
Documentationhttps://javadoc.io/doc/com.sun.faces/jsf-api/2.0.9-08/index.html
Downloadhttps://mvnrepository.com/artifact/com.sun.faces/jsf-api/2.0.9-08
JSF/Jakarta Faces 2.0 ReleasesView full list

What Is New in JSF 2.0

JSF 2.0 was a major overhaul focused on developer productivity and modern web application features. It introduced annotations, Ajax integration, and a component-based development model that significantly reduced boilerplate code.

Category Key Changes
New Features Facelets as default view handler, Standard Ajax support, Composite Components, Resource Handling
Annotations Dependency Injection with @ManagedBean, @ManagedProperty, Scoping with @RequestScoped, @ViewScoped
System Events New event model for lifecycle phase, component, and application events
Navigation Implicit navigation based on outcome, Conditional navigation
Validation & Conversion Bean Validation (JSR-303) integration

How did JSF 2.0 simplify backing bean management?

JSF 2.0 eliminated the need for verbose faces-config.xml declarations through annotations. You can now define a managed bean and its scope directly in the Java class.

This approach is much faster and keeps the configuration tightly coupled with the code it affects. In practice, it made creating and managing the model layer of a JSF application feel more natural and less XML-heavy.

Example with Annotations

@ManagedBean
@RequestScoped
public class UserBean {
    @ManagedProperty(value="#{param.id}")
    private String userId;
    // ... getters and setters
}

What Ajax capabilities were added to JSF 2.0?

JSF 2.0 built Ajax right into the core framework with the <f:ajax> tag. This allowed you to add partial page rendering and asynchronous behavior to any component without external libraries.

You could easily specify which components to execute and which to render after an Ajax event. This was a game-changer for creating dynamic, desktop-like user experiences without complicated JavaScript integration.

Basic Ajax Example

<h:inputText value="#{bean.value}">
    <f:ajax event="keyup" render="output" />
</h:inputText>
<h:outputText id="output" value="#{bean.value}" />

Why was Facelets made the default view technology?

Facelets replaced JSP as the recommended and default view handler because it was designed specifically for JSF's component tree model. It offered a more natural templating system, better error reporting, and higher performance.

Features like composite components and decorating entire pages became possible because of Facelets. This shift resolved many of the compatibility and lifecycle conflicts that existed when using JSP with JSF 1.x.

How did resource handling improve in JSF 2.0?

The framework introduced a standard way to manage CSS, JavaScript, and images through the Resource API and the <h:outputScript> and <h:outputStylesheet> tags.

You could now place resources in a dedicated /resources directory and reference them easily. The framework also handles versioning and packaging, which simplifies deployment and caching.

Resource Directory Structure

WebContent
|-- resources
    |-- css
        |-- style.css
    |-- js
        |-- script.js
    |-- images
        |-- logo.png

FAQ

Do I have to use Facelets in JSF 2.0, or can I still use JSP?
While JSP is still supported for backward compatibility, Facelets is the default and recommended view technology. New projects should absolutely use Facelets for its superior performance, templating, and component support.

Can I use JSF 2.0 Ajax alongside a third-party library like RichFaces?
Yes, the standard <f:ajax> component is designed to work alongside component library Ajax features. However, you might choose one approach for consistency within a project.

What is the difference between @ManagedBean and @Named?
@ManagedBean is the JSF-specific annotation. @Named is part of CDI (Contexts and Dependency Injection). In JSF 2.0, @ManagedBean is the standard, but CDI integration becomes more prominent in later versions.

How do composite components reduce development time?
They allow you to create new components from existing ones using only XHTML, without writing any Java code. This lets teams build a library of reusable UI widgets specific to their application's needs.

Does implicit navigation work with conditional outcomes?
Yes, you can return a String outcome from an action method, and JSF will automatically navigate to the page with that name. For conditions, you can use the <h:link> or <h:button> outcome attribute.

Releases In Branch 2.0

VersionRelease date
2.0.9-0812 May 2018
(8 years ago)
2.0.4-b1613 Apr 2018
(8 years ago)
2.0.0-b2107 Jan 2017
(9 years ago)
2.0.4-b1515 Jul 2016
(10 years ago)
2.0.11-0414 Jul 2016
(10 years ago)
2.0.4-b1413 Jul 2016
(10 years ago)
2.0.9-0606 Jul 2016
(10 years ago)
2.0.11-0324 May 2016
(10 years ago)
2.0.9-0519 Apr 2016
(10 years ago)
2.0.4-b1314 Apr 2016
(10 years ago)
2.0.9-0410 Aug 2015
(10 years ago)
2.0.9-0319 May 2015
(11 years ago)
2.0.4-1316 May 2015
(11 years ago)
2.0.11-0215 May 2015
(11 years ago)
2.0.11-0114 May 2014
(12 years ago)
2.0.9-0211 Mar 2014
(12 years ago)
2.0.4-1211 Mar 2014
(12 years ago)
2.0.4-b1225 Jul 2013
(13 years ago)
2.0.1113 Feb 2013
(13 years ago)
2.0.1018 Dec 2012
(13 years ago)
2.0.4-b1108 Aug 2012
(14 years ago)
2.0.4-b1030 Jul 2012
(14 years ago)
2.0.902 Feb 2012
(14 years ago)
2.0.809 Jan 2012
(14 years ago)
2.0.721 Dec 2011
(14 years ago)
2.0.0-b1303 Aug 2011
(15 years ago)
2.0.4-b0403 Aug 2011
(15 years ago)
2.0.2-b1003 Aug 2011
(15 years ago)
2.0.003 Aug 2011
(15 years ago)
2.0.603 Aug 2011
(15 years ago)
2.0.5-b0203 Aug 2011
(15 years ago)
2.0.0-b0403 Aug 2011
(15 years ago)
2.0.4-b0803 Aug 2011
(15 years ago)
2.0.4-b0703 Aug 2011
(15 years ago)
2.0.0-b0803 Aug 2011
(15 years ago)
2.0.4-b0203 Aug 2011
(15 years ago)
2.0.2-b0403 Aug 2011
(15 years ago)
2.0.1-b0103 Aug 2011
(15 years ago)
2.0.0-b1603 Aug 2011
(15 years ago)
2.0.0-b1503 Aug 2011
(15 years ago)
2.0.303 Aug 2011
(15 years ago)
2.0.1-b0203 Aug 2011
(15 years ago)
2.0.3-b0303 Aug 2011
(15 years ago)
2.0.103 Aug 2011
(15 years ago)
2.0.0-b1003 Aug 2011
(15 years ago)
2.0.2-b0903 Aug 2011
(15 years ago)
2.0.0-b2203 Aug 2011
(15 years ago)
2.0.4-b0303 Aug 2011
(15 years ago)
2.0.0-b0903 Aug 2011
(15 years ago)
2.0.2-b0203 Aug 2011
(15 years ago)
2.0.0-b2003 Aug 2011
(15 years ago)
2.0.0-b1103 Aug 2011
(15 years ago)
2.0.0-b0503 Aug 2011
(15 years ago)
2.0.4-b0603 Aug 2011
(15 years ago)
2.0.2-b0503 Aug 2011
(15 years ago)
2.0.0-b1803 Aug 2011
(15 years ago)
2.0.3-b0103 Aug 2011
(15 years ago)
2.0.2-b0303 Aug 2011
(15 years ago)
2.0.203 Aug 2011
(15 years ago)
2.0.2-b0603 Aug 2011
(15 years ago)
2.0.0-b0703 Aug 2011
(15 years ago)
2.0.2-b0703 Aug 2011
(15 years ago)
2.0.0-b2303 Aug 2011
(15 years ago)
2.0.0-b1403 Aug 2011
(15 years ago)
2.0.5-b0103 Aug 2011
(15 years ago)
2.0.4-b0503 Aug 2011
(15 years ago)
2.0.2-b0803 Aug 2011
(15 years ago)
2.0.4-b0903 Aug 2011
(15 years ago)
2.0.0-b1903 Aug 2011
(15 years ago)
2.0.2-b0103 Aug 2011
(15 years ago)
2.0.0-b1203 Aug 2011
(15 years ago)
2.0.0-b1703 Aug 2011
(15 years ago)
2.0.3-b0505 Oct 2010
(15 years ago)
2.0.3-b0416 Sep 2010
(15 years ago)
2.0.3-b0219 Jun 2010
(16 years ago)