Class FacesContext
- java.lang.Object
- 
- jakarta.faces.context.FacesContext
 
- 
- Direct Known Subclasses:
- FacesContextWrapper
 
 public abstract class FacesContext extends Object see Javadoc of Faces Specification
- 
- 
Constructor SummaryConstructors Constructor Description FacesContext()
 - 
Method Summary
 
- 
- 
- 
Method Detail- 
addMessagepublic abstract void addMessage(String clientId, FacesMessage message) 
 - 
getApplicationpublic abstract Application getApplication() 
 - 
getCurrentInstancepublic static FacesContext getCurrentInstance() 
 - 
getCurrentPhaseIdpublic PhaseId getCurrentPhaseId() - Returns:
- Since:
- 2.0
 
 - 
getELContextpublic jakarta.el.ELContext getELContext() Return the context within which all EL-expressions are evaluated.A Faces implementation is expected to provide a full implementation of this class. However Faces also explicitly allows user code to apply the "decorator" pattern to this type, by overriding the FacesContextFactory class. In that pattern, the decorating class has a reference to an "underlying" implementation and forward calls to it, possibly after taking other related actions. The decorator pattern does have difficulties with backwards-compatibility when new methods are added to the class being decorated, as with this method which was added in Faces1.2. Decorator classes that were written for Faces1.1 will subclass this class, but will not override this method to pass the call on to the "underlying" instance. This base implementation therefore must do that for it. Unfortunately the Faces designers stuffed up the design; this base class has no way of knowing what the "underlying" instance is! The current implementation here is therefore to delegate directly to the very first FacesContext instance registered within this request (via setCurrentInstance). This instance should be the "full" implementation provided by the Faces framework. The drawback is that when any decorator class is present which defaults to this base implementation, then any following decorator instances that do override this method do not get it invoked. It is believed that the Sun Faces implementation (Mojarra) does something similar. - Since:
- 1.2
 
 - 
getExceptionHandlerpublic ExceptionHandler getExceptionHandler() - Returns:
- Since:
- 2.0
 
 - 
getExternalContextpublic abstract ExternalContext getExternalContext() 
 - 
getMaximumSeveritypublic abstract FacesMessage.Severity getMaximumSeverity() 
 - 
getMessageListpublic List<FacesMessage> getMessageList() - Returns:
- Since:
- 2.0
 
 - 
getMessageListpublic List<FacesMessage> getMessageList(String clientId) - Parameters:
- clientId-
- Returns:
- Since:
- 2.0
 
 - 
getMessagespublic abstract Iterator<FacesMessage> getMessages() 
 - 
getMessagespublic abstract Iterator<FacesMessage> getMessages(String clientId) 
 - 
getPartialViewContextpublic PartialViewContext getPartialViewContext() Return the PartialViewContext for this request. The PartialViewContext is used to control the processing of specified components during the execute portion of the request processing lifecycle (known as partial processing) and the rendering of specified components (known as partial rendering). This method must return a new PartialViewContext if one does not already exist. - Returns:
- The PartialViewContext
- Throws:
- IllegalStateException- if this method is called after this instance has been released
- Since:
- 2.0
 
 - 
getRenderKitpublic abstract RenderKit getRenderKit() 
 - 
getRenderResponsepublic abstract boolean getRenderResponse() 
 - 
getResponseCompletepublic abstract boolean getResponseComplete() 
 - 
getResponseStreampublic abstract ResponseStream getResponseStream() 
 - 
getResponseWriterpublic abstract ResponseWriter getResponseWriter() 
 - 
isValidationFailedpublic boolean isValidationFailed() - Returns:
- Since:
- 2.0
 
 - 
getViewRootpublic abstract UIViewRoot getViewRoot() 
 - 
isPostbackpublic boolean isPostback() - Returns:
- Since:
- 2.0
 
 - 
isProcessingEventspublic boolean isProcessingEvents() - Returns:
- Since:
- 2.0
 
 - 
releasepublic abstract void release() 
 - 
renderResponsepublic abstract void renderResponse() 
 - 
responseCompletepublic abstract void responseComplete() 
 - 
setCurrentInstanceprotected static void setCurrentInstance(FacesContext context) 
 - 
setCurrentPhaseIdpublic void setCurrentPhaseId(PhaseId currentPhaseId) - Parameters:
- currentPhaseId-
- Since:
- 2.0
 
 - 
setExceptionHandlerpublic void setExceptionHandler(ExceptionHandler exceptionHandler) - Parameters:
- exceptionHandler-
- Since:
- 2.0
 
 - 
setProcessingEventspublic void setProcessingEvents(boolean processingEvents) - Parameters:
- processingEvents-
- Since:
- 2.0
 
 - 
setResponseStreampublic abstract void setResponseStream(ResponseStream responseStream) 
 - 
setResponseWriterpublic abstract void setResponseWriter(ResponseWriter responseWriter) 
 - 
setViewRootpublic abstract void setViewRoot(UIViewRoot root) 
 - 
validationFailedpublic void validationFailed() - Since:
- 2.0
 
 - 
isProjectStagepublic boolean isProjectStage(ProjectStage stage) 
 - 
isReleasedpublic boolean isReleased() - Returns:
- Since:
- 2.1
 
 - 
setResourceLibraryContractspublic void setResourceLibraryContracts(List<String> contracts) - Parameters:
- contracts-
- Since:
- 2.2
 
 - 
getNamingContainerSeparatorCharpublic char getNamingContainerSeparatorChar() - Returns:
- Since:
- 2.2
 
 - 
getLifecyclepublic abstract Lifecycle getLifecycle() - Returns:
- the current Lifecycle
- Since:
- 4.0
 
 
- 
 
-