🔥 JavaServer Faces Cheat Sheet

orestispantazos

Orestis Pantazos

Posted on December 30, 2019

🔥 JavaServer Faces Cheat Sheet

The JSF framework supports these annotations but are deprecated in JSF 2.3 and will not be used anymore.

Annotation Annotation Class
@RequestScoped javax.faces.bean.RequestScoped
@SessionScoped javax.faces.bean.SessionScoped
@ApplicationScoped javax.faces.bean.ApplicationScoped
@ViewScoped javax.faces.bean.ViewScoped
@NoneScoped javax.faces.bean.NoneScoped
@CustomScoped(value="#{someMap}") javax.faces.bean.CustomScoped

It is recommended to use JSF CDI annotations as shown in the following table:

Annotation (CDI) Annotation Class
@RequestScoped javax.enterprise.context.RequestScoped
@SessionScoped javax.enterprise.context.SessionScoped
@ApplicationScoped javax.enterprise.context.ApplicationScoped
@FlowScoped javax.faces.flows.FlowScoped
@Dependent javax.enterprise.context.Dependent
💖 💪 🙅 🚩
orestispantazos
Orestis Pantazos

Posted on December 30, 2019

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related