Top Description Fields Constructors Methods
com.sun.faces.context

public Class InjectionFacesContextFactory

extends FacesContextFactory
Class Inheritance
Imports
java.lang.reflect.Field, java.text.MessageFormat, java.util.logging.Level, .Logger, com.sun.faces.util.FacesLogger, .Util, jakarta.faces.FacesException, jakarta.faces.context.ExternalContext, .FacesContext, .FacesContextFactory, jakarta.faces.lifecycle.Lifecycle, jakarta.servlet.ServletRequest

This FacesContextFactory is responsible for injecting the default FacesContext instance into the top-level FacesContext as configured by the runtime. Doing this allows us to preserve backwards compatibility as the API evolves without having the API rely on implementation specific details.

Field Summary

Modifier and TypeField and Description
private Field
private Field
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public FacesContext
getFacesContext(Object
In Jakarta Servlet environments, the ServletContext that is associated with this web application
context
,
Object
In Jakarta Servlet environments, the ServletRequest that is to be processed
request
,
Object
In Jakarta Servlet environments, the ServletResponse that is to be processed
response
,
Lifecycle
The Lifecycle instance being used to process this request
lifecycle
)

Implements abstract jakarta.faces.context.FacesContextFactory.getFacesContext.

Create (if needed) and return a FacesContext instance that is initialized for the processing of the specified request and response objects, utilizing the specified Lifecycle instance, for this web application.

private void
Inherited from jakarta.faces.context.FacesContextFactory:
getWrapped

Field Detail

defaultExternalContextback to summary
private Field defaultExternalContext
defaultFacesContextback to summary
private Field defaultFacesContext
LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

InjectionFacesContextFactoryback to summary
public InjectionFacesContextFactory(FacesContextFactory delegate)

Method Detail

getFacesContextback to summary
public FacesContext getFacesContext(Object context, Object request, Object response, Lifecycle lifecycle) throws FacesException

Implements abstract jakarta.faces.context.FacesContextFactory.getFacesContext.

Doc from jakarta.faces.context.FacesContextFactory.getFacesContext.

Create (if needed) and return a FacesContext instance that is initialized for the processing of the specified request and response objects, utilizing the specified Lifecycle instance, for this web application.

The implementation of this method must ensure that calls to the getCurrentInstance() method of FacesContext, from the same thread that called this method, will return the same FacesContext instance until the release() method is called on that instance.

The implementation must call ExternalContextFactory#getExternalContext to produce the ExternalContext for the FacesContext instance.

The default implementation must call ExceptionHandlerFactory#getExceptionHandler and make it so the return from that method is what gets returned from a call to FacesContext#getExceptionHandler on the returned FacesContext instance.

The default implementation must call jakarta.faces.lifecycle.ClientWindowFactory#getClientWindow and make it so the return from that method is what gets returned from a call to ExternalContext#getClientWindow() on the returned ExternalContext instance.

Parameters
context:Object

In Jakarta Servlet environments, the ServletContext that is associated with this web application

request:Object

In Jakarta Servlet environments, the ServletRequest that is to be processed

response:Object

In Jakarta Servlet environments, the ServletResponse that is to be processed

lifecycle:Lifecycle

The Lifecycle instance being used to process this request

Returns:FacesContext

the instance of FacesContext.

Annotations
@Override
Exceptions
FacesException:
if a FacesContext cannot be constructed for the specified parameters
injectDefaultsback to summary
private void injectDefaults(FacesContext target, Object request)