- Direct Known Subclasses:
InitFacesContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMessage(String clientId, FacesMessage message) Append aFacesMessageto the set of messages associated with the specified client identifier, ifclientIdis notnull.Return anIteratorover the client identifiers for which at least oneFacesMessagehas been queued.Return the maximum severity level recorded on anyFacesMessages that has been queued, whether or not they are associated with any specificUIComponent.LikeFacesContext.getMessages(), but returns aList<FacesMessage>, enabling use from Jakarta Expression Language expressions.getMessageList(String clientId) LikeFacesContext.getMessages(java.lang.String), but returns aList<FacesMessage>of messages for the component with client id matching argumentclientId.Return anIteratorover theFacesMessages that have been queued, whether or not they are associated with any specific client identifier.getMessages(String clientId) Return anIteratorover theFacesMessages that have been queued that are associated with the specified client identifier (ifclientIdis notnull), or over theFacesMessages that have been queued that are not associated with any specific client identifier (ifclientIdisnull).Return theRenderKitinstance for the render kit identifier specified on ourUIViewRoot, if there is one.booleanReturntrueif therenderResponse()method has been called for the current request.booleanReturntrueif theresponseComplete()method has been called for the current request.Return theResponseStreamto which components should direct their binary output.Return theResponseWriterto which components should direct their character-based output.booleanReturntrueif thevalidationFailed()method has been called for the current request.voidSignal the Jakarta Faces implementation that, as soon as the current phase of the request processing lifecycle has been completed, control should be passed to the Render Response phase, bypassing any phases that have not been executed yet.voidSignal the Jakarta Faces implementation that the HTTP response for this request has already been generated (such as an HTTP redirect), and that the request processing lifecycle should be terminated as soon as the current phase is completed.voidsetResponseStream(ResponseStream responseStream) Set theResponseStreamto which components should direct their binary output.voidsetResponseWriter(ResponseWriter responseWriter) Set theResponseWriterto which components should direct their character-based output.voidsetViewRoot(UIViewRoot root) Set the root component that is associated with this request.voidSets a flag which indicates that a conversion or validation error occurred while processing the inputs.Methods inherited from class jakarta.faces.context.FacesContext
getApplication, getAttributes, getCurrentInstance, getCurrentPhaseId, getELContext, getExceptionHandler, getExternalContext, getNamingContainerSeparatorChar, getPartialViewContext, getResourceLibraryContracts, getViewRoot, isPostback, isProcessingEvents, isProjectStage, isReleased, release, setCurrentInstance, setCurrentPhaseId, setExceptionHandler, setProcessingEvents, setResourceLibraryContracts
-
Constructor Details
-
NoOpFacesContext
public NoOpFacesContext()
-
-
Method Details
-
getLifecycle
Description copied from class:FacesContextReturn the
Lifecycleinstance for thisFacesContextinstance.- Specified by:
getLifecyclein classFacesContext- Returns:
- instance of
Lifecycle
-
getClientIdsWithMessages
Description copied from class:FacesContextReturn an
Iteratorover the client identifiers for which at least oneFacesMessagehas been queued. If there are no such client identifiers, an emptyIteratoris returned. If any messages have been queued that were not associated with any specific client identifier, anullvalue will be included in the iterated values. The elements in theIteratormust be returned in the order in which they were added withFacesContext.addMessage(java.lang.String, jakarta.faces.application.FacesMessage).- Specified by:
getClientIdsWithMessagesin classFacesContext- Returns:
- the
Iteratorover the client identifiers for which at least oneFacesMessagehas been queued.
-
getMaximumSeverity
Description copied from class:FacesContextReturn the maximum severity level recorded on any
FacesMessages that has been queued, whether or not they are associated with any specificUIComponent. If no such messages have been queued, returnnull.- Specified by:
getMaximumSeverityin classFacesContext- Returns:
- the maximum severity level.
-
getMessages
Description copied from class:FacesContextReturn an
Iteratorover theFacesMessages that have been queued, whether or not they are associated with any specific client identifier. If no such messages have been queued, return an emptyIterator. The elements of theIteratormust be returned in the order in which they were added with calls toFacesContext.addMessage(java.lang.String, jakarta.faces.application.FacesMessage).- Specified by:
getMessagesin classFacesContext- Returns:
Iteratorover theFacesMessages that have been queued.
-
getMessages
Description copied from class:FacesContextReturn an
Iteratorover theFacesMessages that have been queued that are associated with the specified client identifier (ifclientIdis notnull), or over theFacesMessages that have been queued that are not associated with any specific client identifier (ifclientIdisnull). If no such messages have been queued, return an emptyIterator. The elements of theIteratormust be returned in the order in which they were added with calls toFacesContext.addMessage(java.lang.String, jakarta.faces.application.FacesMessage).- Specified by:
getMessagesin classFacesContext- Parameters:
clientId- The client identifier for which messages are requested, ornullfor messages not associated with any client identifier- Returns:
Iteratorover theFacesMessages.
-
getMessageList
Description copied from class:FacesContextLike
FacesContext.getMessages(), but returns aList<FacesMessage>, enabling use from Jakarta Expression Language expressions.The default implementation throws
UnsupportedOperationExceptionand is provided for the sole purpose of not breaking existing applications that extend this class.- Overrides:
getMessageListin classFacesContext- Returns:
- an immutable
Listwhich is effectively a snapshot of the messages present at the time of invocation.
-
getMessageList
Description copied from class:FacesContextLike
FacesContext.getMessages(java.lang.String), but returns aList<FacesMessage>of messages for the component with client id matching argumentclientId.The default implementation throws
UnsupportedOperationExceptionand is provided for the sole purpose of not breaking existing applications that extend this class.- Overrides:
getMessageListin classFacesContext- Parameters:
clientId- the client id of a component.- Returns:
- an immutable
Listwhich is effectively a snapshot of the messages present at the time of invocation.
-
getRenderKit
Description copied from class:FacesContextReturn the
RenderKitinstance for the render kit identifier specified on ourUIViewRoot, if there is one. If there is no currentUIViewRoot, if theUIViewRootdoes not have a specifiedrenderKitId, or if there is noRenderKitfor the specified identifier, returnnullinstead.- Specified by:
getRenderKitin classFacesContext- Returns:
- instance of
RenderKitassociated with theUIViewRoot.
-
getRenderResponse
public boolean getRenderResponse()Description copied from class:FacesContextReturn
trueif therenderResponse()method has been called for the current request.- Specified by:
getRenderResponsein classFacesContext- Returns:
- flag indicating whether the
renderResponse()has been called.
-
getResponseComplete
public boolean getResponseComplete()Description copied from class:FacesContextReturn
trueif theresponseComplete()method has been called for the current request.- Specified by:
getResponseCompletein classFacesContext- Returns:
- the boolean indicating whether
responseComplete()method has been called.
-
isValidationFailed
public boolean isValidationFailed()Description copied from class:FacesContextReturn
trueif thevalidationFailed()method has been called for the current request.- Overrides:
isValidationFailedin classFacesContext- Returns:
- boolean indicating if the
validationFailed()method has been called for the current request
-
getResponseStream
Description copied from class:FacesContextReturn the
ResponseStreamto which components should direct their binary output. Within a given response, components can use either the ResponseStream or the ResponseWriter, but not both.- Specified by:
getResponseStreamin classFacesContext- Returns:
ResponseStreaminstance.
-
setResponseStream
Description copied from class:FacesContextSet the
ResponseStreamto which components should direct their binary output.- Specified by:
setResponseStreamin classFacesContext- Parameters:
responseStream- The new ResponseStream for this response
-
getResponseWriter
Description copied from class:FacesContextReturn the
ResponseWriterto which components should direct their character-based output. Within a given response, components can use either the ResponseStream or the ResponseWriter, but not both.- Specified by:
getResponseWriterin classFacesContext- Returns:
ResponseWriterinstance.
-
setResponseWriter
Description copied from class:FacesContextSet the
ResponseWriterto which components should direct their character-based output.- Specified by:
setResponseWriterin classFacesContext- Parameters:
responseWriter- The new ResponseWriter for this response
-
setViewRoot
Description copied from class:FacesContextSet the root component that is associated with this request.
This method can be called by the application handler (or a class that the handler calls), during the Invoke Application phase of the request processing lifecycle and during the Restore View phase of the request processing lifecycle (especially when a new root component is created). In the present version of the specification, implementations are not required to enforce this restriction, though a future version of the specification may require enforcement.
If the current
UIViewRootis non-null, and callingequals()on the argumentroot, passing the currentUIViewRootreturnsfalse, theclearmethod must be called on theMapreturned fromUIViewRoot.getViewMap().- Specified by:
setViewRootin classFacesContext- Parameters:
root- The new componentUIViewRootcomponent
-
addMessage
Description copied from class:FacesContextAppend a
FacesMessageto the set of messages associated with the specified client identifier, ifclientIdis notnull. IfclientIdisnull, thisFacesMessageis assumed to not be associated with any specific component instance.- Specified by:
addMessagein classFacesContext- Parameters:
clientId- The client identifier with which this message is associated (if any)message- The message to be appended
-
renderResponse
public void renderResponse()Description copied from class:FacesContextSignal the Jakarta Faces implementation that, as soon as the current phase of the request processing lifecycle has been completed, control should be passed to the Render Response phase, bypassing any phases that have not been executed yet.
- Specified by:
renderResponsein classFacesContext
-
responseComplete
public void responseComplete()Description copied from class:FacesContextSignal the Jakarta Faces implementation that the HTTP response for this request has already been generated (such as an HTTP redirect), and that the request processing lifecycle should be terminated as soon as the current phase is completed.
- Specified by:
responseCompletein classFacesContext
-
validationFailed
public void validationFailed()Description copied from class:FacesContextSets a flag which indicates that a conversion or validation error occurred while processing the inputs. Inputs consist of either page parameters or form bindings. This flag can be read using
FacesContext.isValidationFailed().- Overrides:
validationFailedin classFacesContext
-