Direct Known Subclasses:
FacesContext contains all of the per-request state information related to the processing of a single JavaServer 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 servlet container
executing this web application utilizes for the processing of this request.
|Method from javax.faces.context.FacesContext Summary:|
|addMessage, getApplication, getAttributes, getClientIdsWithMessages, getCurrentInstance, getCurrentPhaseId, getELContext, getExceptionHandler, getExternalContext, getMaximumSeverity, getMessageList, getMessageList, getMessages, getMessages, getPartialViewContext, getRenderKit, getRenderResponse, getResponseComplete, getResponseStream, getResponseWriter, getViewRoot, isPostback, isProcessingEvents, isProjectStage, isValidationFailed, release, renderResponse, responseComplete, setCurrentInstance, setCurrentPhaseId, setExceptionHandler, setProcessingEvents, setResponseStream, setResponseWriter, setViewRoot, validationFailed|
|Methods from java.lang.Object:|
|clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait|
|Method from javax.faces.context.FacesContext Detail:|
abstract public void addMessage(String clientId, FacesMessage message)
abstract public Application getApplication()
public Map<Object, Object> getAttributes()
Return a mutable
The default implementation throws
abstract public Iterator<String> getClientIdsWithMessages()
public static FacesContext getCurrentInstance()
Return the FacesContext instance for the request that is being processed by the current thread. If called during application initialization or shutdown, any method documented as "valid to call this method during application startup or shutdown" must be supported during application startup or shutdown time. The result of calling a method during application startup or shutdown time that does not have this designation is undefined.
public PhaseId getCurrentPhaseId()
Return the value last set on this
public ELContext getELContext()
Return the ExceptionHandler for this request.
abstract public ExternalContext getExternalContext()
Return the ExternalContext instance for this
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.
abstract public Severity getMaximumSeverity()
public List<FacesMessage> getMessageList()
Like #getMessages , but
The default implementation throws
public List<FacesMessage> getMessageList(String clientId)
Like #getMessages(java.lang.String) , but returns a
The default implementation throws
abstract public Iterator<FacesMessage> getMessages()
abstract public Iterator<FacesMessage> getMessages(String clientId)
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.
abstract public RenderKit getRenderKit()
abstract public boolean getRenderResponse()
abstract public boolean getResponseComplete()
abstract public ResponseStream getResponseStream()
Return the ResponseStream to which components should direct their binary output. Within a given response, components can use either the ResponseStream or the ResponseWriter, but not both.
abstract public ResponseWriter getResponseWriter()
Return the ResponseWriter to which components should direct their character-based output. Within a given response, components can use either the ResponseStream or the ResponseWriter, but not both.
abstract public UIViewRoot getViewRoot()
Return 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
public boolean isPostback()
This utility method simply returns the result of javax.faces.render.ResponseStateManager#isPostback(FacesContext) .
public boolean isProcessingEvents()
Returns a flag indicating whether or not the runtime should publish events when asked to do so.
public boolean isProjectStage(ProjectStage stage)
public boolean isValidationFailed()
abstract public void release()
resources associated with this
If a call was made to #getAttributes during the processing for this request, the
implementation must call
The implementation must call #setCurrentInstance
abstract public void renderResponse()
Signal the JavaServer 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.
abstract public void responseComplete()
Signal the JavaServer 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.
protected static void setCurrentInstance(FacesContext context)
Set the FacesContext instance for the request that is being processed by the current thread.
public void setCurrentPhaseId(PhaseId currentPhaseId)
The implementation must call this method at the earliest possble point in time after entering into a new phase in the request processing lifecycle.
public void setExceptionHandler(ExceptionHandler exceptionHandler)
Set the ExceptionHandler for this request.
public void setProcessingEvents(boolean processingEvents)
Allows control of wheter or not the runtime will publish events when Application#publishEvent(FacesContext, Class, Object) or Application#publishEvent(FacesContext, Class, Class, Object) is called.
abstract public void setResponseStream(ResponseStream responseStream)
Set the ResponseStream to which components should direct their binary output.
abstract public void setResponseWriter(ResponseWriter responseWriter)
Set the ResponseWriter to which components should direct their character-based output.
abstract public void setViewRoot(UIViewRoot root)
Set the root component that is associated with this request. This method can only be called by the application handler (or a class that the handler calls), and only during the Invoke Application phase of the request processing lifecycle.
If the current
public void validationFailed()
Sets 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 #isValidationFailed .