Class FacesContext

java.lang.Object
jakarta.faces.context.FacesContext
Direct Known Subclasses:
FacesContextImpl, FacesContextWrapper, NoOpFacesContext

public abstract class FacesContext extends Object

FacesContext contains all of the per-request state information related to the processing of a single Jakarta Faces request, and the rendering of the corresponding response. It is passed to, and potentially modified by, each phase of the request processing lifecycle.

A FacesContext instance is associated with a particular request at the beginning of request processing, by a call to the getFacesContext() method of the FacesContextFactory instance associated with the current web application. The instance remains active until its release() method is called, after which no further references to this instance are allowed. While a FacesContext instance is active, it must not be referenced from any thread other than the one upon which the Jakarta Servlet container executing this web application utilizes for the processing of this request.

A FacesContext can be injected into a request scoped bean using @Inject FacesContext facesContext;