Faces Managed Beans, which were deprecated in JavaServer Faces 2.3, have been removed from Jakarta Faces 4.0. The specification for managed beans from Jakarta Server Faces has been placed into its own specifications, namely Jakarta Managed Beans and CDI. All managed beans must be converted to Contexts and Dependency Injection (CDI) beans. The following substitutions are recommended:
Managed Bean Annotation |
Recommended CDI Replacement |
Notes (see documentation) |
|---|---|---|
ManagedBean |
CDI bean | "This has been replaced by the Managed Beans specification in general and specifically the dependency injection, scopes and naming from the CDI specification." |
ReferencedBean |
None, see notes | "The referenced-bean concept was used for a design time promise which however did not achieve widespread adoption." |
ManagedProperty |
jakarta.faces.annotation.ManagedProperty |
"This has been replaced by jakarta.faces.annotation.ManagedProperty, which is a CDI build-in bean with similar semantics." |
ApplicationScoped |
jakarta.enterprise.context.ApplicationScoped |
"This has been replaced by jakarta.enterprise.context.ApplicationScoped, which is a CDI build-in scope with similar semantics." |
CustomScoped |
CDI custom scopes | "This has been replaced by CDI custom scopes and jakarta.enterprise.context.spi.Context." |
NoneScoped |
jakarta.enterprise.context.Dependent |
"This has been replaced by jakarta.enterprise.context.Dependent, which is a CDI build-in scope with approximately similar semantics." |
RequestScoped |
jakarta.enterprise.context.RequestScoped |
"This has been replaced by jakarta.enterprise.context.RequestScoped,, which is a CDI build-in scope with similar semantics." |
SessionScoped |
jakarta.enterprise.context.SessionScoped |
"This has been replaced by jakarta.enterprise.context.SessionScoped, which is a CDI build-in scope with similar semantics." |
ViewScoped |
jakarta.faces.view.ViewScoped |
"This has been replaced by jakarta.faces.view.ViewScoped." |
This rule is flagged once per class or file.
For more information on enabling and using CDI in Liberty, consult the Open Liberty documentation.
This rule has an automated fix to update the deprecated Managed Beans Annotations where possible. Copy the custom configuration to your application build file to enable the fix automation.
For more Jakarta 10 migration information, see Differences between Jakarta Faces 4.0 and 3.0.