public class InitFacesContext extends NoOpFacesContext
| Constructor and Description |
|---|
InitFacesContext(jakarta.servlet.ServletContext servletContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
addInitContextEntryForCurrentThread() |
void |
addServletContextEntryForInitContext(jakarta.servlet.ServletContext servletContext) |
static void |
cleanupInitMaps(jakarta.servlet.ServletContext servletContext)
Clean up entries from the threadInitContext and initContextServletContext maps using a ServletContext.
|
jakarta.faces.application.Application |
getApplication()
Return the
Application instance associated with this web
application. |
Map<Object,Object> |
getAttributes()
Return a mutable |
jakarta.el.ELContext |
getELContext()
Return the
ELContext instance for this FacesContext instance. |
jakarta.faces.context.ExternalContext |
getExternalContext()
Return the
ExternalContext instance for this
FacesContext instance. |
static InitFacesContext |
getInstance(jakarta.servlet.ServletContext servletContext) |
jakarta.faces.component.UIViewRoot |
getViewRoot()
Return the root component that is associated with the this request.
|
boolean |
isProjectStage(jakarta.faces.application.ProjectStage stage)
Return |
void |
reInitializeExternalContext(jakarta.servlet.ServletContext sc) |
void |
release()
Release any resources associated with this
FacesContext
instance. |
void |
releaseCurrentInstance() |
void |
removeInitContextEntryForCurrentThread() |
void |
removeServletContextEntryForInitContext() |
void |
setELContext(jakarta.el.ELContext elContext) |
addMessage, getClientIdsWithMessages, getMaximumSeverity, getMessageList, getMessageList, getMessages, getMessages, getRenderKit, getRenderResponse, getResponseComplete, getResponseStream, getResponseWriter, isValidationFailed, renderResponse, responseComplete, setResponseStream, setResponseWriter, setViewRoot, validationFailedgetCurrentInstance, getCurrentPhaseId, getExceptionHandler, getNamingContainerSeparatorChar, getPartialViewContext, getResourceLibraryContracts, isPostback, isProcessingEvents, isReleased, setCurrentInstance, setCurrentPhaseId, setExceptionHandler, setProcessingEvents, setResourceLibraryContractspublic InitFacesContext(jakarta.servlet.ServletContext servletContext)
public Map<Object,Object> getAttributes()
jakarta.faces.context.FacesContext
Return a mutable Map representing the attributes associated wth this FacesContext instance.
This Map is useful to store attributes that you want to go out of scope when the Faces lifecycle for the
current request ends, which is not always the same as the request ending, especially in the case of Jakarta Servlet
filters that are invoked after the Faces lifecycle for this request completes. Accessing this
Map does not cause any events to fire, as is the case with the other maps: for request, session, and
application scope. When FacesContext.release() is invoked, the attributes must be cleared.
The Map returned by this method is not associated with the request. If you would like to get or set
request attributes, see ExternalContext.getRequestMap().
The default implementation throws UnsupportedOperationException and is provided for the sole purpose of
not breaking existing applications that extend this class.
getAttributes in class jakarta.faces.context.FacesContextMap representing the attributes associated wth this FacesContext instance.public jakarta.faces.context.ExternalContext getExternalContext()
jakarta.faces.context.FacesContext
Return the ExternalContext instance for this
FacesContext instance.
It is valid to call this method during application startup or shutdown. If called during application startup or
shutdown, this method returns an ExternalContext instance with the special behaviors indicated in the javadoc
for that class. Methods document as being valid to call during application startup or shutdown must be supported.
getExternalContext in class jakarta.faces.context.FacesContextExternalContextpublic jakarta.faces.component.UIViewRoot getViewRoot()
jakarta.faces.context.FacesContextReturn the root component that is associated with the this request.
It is valid to call this method during application startup or shutdown. If called during application startup or
shutdown, this method returns a new UIViewRoot with its locale set to Locale.getDefault().
getViewRoot in class jakarta.faces.context.FacesContextUIViewRoot instance.public jakarta.el.ELContext getELContext()
jakarta.faces.context.FacesContext
Return the ELContext instance for this FacesContext instance. This ELContext
instance has the same lifetime and scope as the FacesContext instance with which it is associated, and
may be created lazily the first time this method is called for a given FacesContext instance. Upon
creation of the ELContext instance, the implementation must take the following action:
Call the ELContext.putContext(java.lang.Class<?>, java.lang.Object) method on the instance, passing in FacesContext.class and the
this reference for the FacesContext instance itself.
If the Collection returned by Application.getELContextListeners() is
non-empty, create an instance of ELContextEvent and pass it to each
ELContextListener instance in the Collection by calling the
ELContextListener.contextCreated(jakarta.el.ELContextEvent) method.
getELContext in class jakarta.faces.context.FacesContextELContext.public void setELContext(jakarta.el.ELContext elContext)
public jakarta.faces.application.Application getApplication()
jakarta.faces.context.FacesContext
Return the Application instance associated with this web
application.
It is valid to call this method during application startup or shutdown. If called during application startup or
shutdown, returns the correct current Application instance.
getApplication in class jakarta.faces.context.FacesContextApplication instance associated with this web application.public boolean isProjectStage(jakarta.faces.application.ProjectStage stage)
jakarta.faces.context.FacesContext
Return true if the current ProjectStage as returned by the Application instance is equal
to stage, otherwise return false
isProjectStage in class jakarta.faces.context.FacesContextstage - the ProjectStage to checkpublic void release()
jakarta.faces.context.FacesContext
Release any resources associated with this FacesContext
instance. Faces implementations may choose to pool instances in the associated FacesContextFactory to avoid
repeated object creation and garbage collection. After release() is called on a
FacesContext instance (until the FacesContext instance has been recycled by the
implementation for re-use), calling any other methods will cause an IllegalStateException to be thrown.
If a call was made to FacesContext.getAttributes() during the processing for this request, the implementation must call
clear() on the Map returned from getAttributes(), and then de-allocate the
data-structure behind that Map.
The implementation must call FacesContext.setCurrentInstance(jakarta.faces.context.FacesContext) passing null to remove the association between
this thread and this dead FacesContext instance.
release in class jakarta.faces.context.FacesContextpublic void releaseCurrentInstance()
public void addInitContextEntryForCurrentThread()
public void removeInitContextEntryForCurrentThread()
public void addServletContextEntryForInitContext(jakarta.servlet.ServletContext servletContext)
public void removeServletContextEntryForInitContext()
public static void cleanupInitMaps(jakarta.servlet.ServletContext servletContext)
servletContext - public static InitFacesContext getInstance(jakarta.servlet.ServletContext servletContext)
public void reInitializeExternalContext(jakarta.servlet.ServletContext sc)
Copyright © 2010–2022 JBoss by Red Hat. All rights reserved.