What Is New in JSF 3.0
JSF 3.0 is a major update that modernizes the framework by aligning with Jakarta EE 9 and introducing new features focused on developer experience and performance.
| Category | Key Changes |
|---|---|
| New Features | CDI-based artifact injection, new f:viewAction component, Faces Flows API |
| Improvements | Enhanced EL 4.0 support, better error reporting, streamlined page navigation |
| API Updates | Migration from javax.faces to jakarta.faces namespace |
| Deprecated/Removed | Removed legacy managed bean system (@ManagedBean, faces-config.xml beans) |
How did the package namespace change in JSF 3.0?
The most significant change is the move from javax.faces to jakarta.faces. This aligns JSF with the broader Jakarta EE 9 platform and is the primary breaking change for existing applications.
In practice, this means you'll need to update all your imports and configuration files. For Maven users, the artifact coordinates also changed from javax.faces:javax.faces-api to jakarta.faces:jakarta.faces-api.
What new CDI integrations are available?
JSF 3.0 fully embraces CDI for artifact injection, making the legacy JSF-specific managed bean system obsolete. You can now use @Inject on managed beans, converters, validators, and behavior listeners.
This matters because it simplifies your architecture by using a single, modern dependency injection standard throughout your application. The old @ManagedBean annotation and bean declarations in faces-config.xml have been removed.
What are the new features for page navigation?
The new f:viewAction component allows you to execute actions during the RESTORE_VIEW phase, before rendering occurs. This is useful for pre-populating data when a page loads.
Faces Flows provides a more structured way to define multi-step, stateful user interactions. It offers a cleaner alternative to managing conversation scope manually and helps encapsulate navigation logic.
How does EL 4.0 improve JSF development?
Integration with Expression Language 4.0 brings method invocations with parameters directly in EL expressions. You can now write things like #{bean.method(param)} right in your XHTML pages.
This eliminates the need for workarounds like passing parameters through f:setPropertyActionListener. It makes your UI code more expressive and reduces the amount of backing bean boilerplate.
FAQ
Is JSF 3.0 backwards compatible with JSF 2.3?
No, the namespace change from javax.faces to jakarta.faces is a breaking change. Existing applications will require code changes and dependency updates to migrate.
Can I still use my existing faces-config.xml file?
Yes, the configuration file is still supported, but you must update the schema version to 3.0 and change the namespace to https://jakarta.ee/xml/ns/jakartaee.
What happened to the @ManagedBean annotation?
It was removed. JSF 3.0 requires the use of CDI for managed beans. You need to replace @ManagedBean with CDI's @Named and manage scope with annotations like @RequestScoped.
Do I need to change my JSF implementation (Mojarra/MyFaces)?
Yes, you must use a version of your chosen implementation that is built for JSF 3.0 and the Jakarta EE namespace, such as Mojarra 3.0 or MyFaces 3.0.
Are there any changes to how components are rendered?
The core rendering lifecycle is unchanged, but the underlying APIs have moved to the jakarta.faces package. Custom component developers will need to update their imports and recompile.