Save This Page
Home » mojarra-1.2_09-b02-FCS-source » javax.faces.context » [javadoc | source]
javax.faces.context
abstract public class: FacesContext [javadoc | source]
java.lang.Object
   javax.faces.context.FacesContext

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,   getClientIdsWithMessages,   getCurrentInstance,   getELContext,   getExternalContext,   getMaximumSeverity,   getMessages,   getMessages,   getRenderKit,   getRenderResponse,   getResponseComplete,   getResponseStream,   getResponseWriter,   getViewRoot,   release,   renderResponse,   responseComplete,   setCurrentInstance,   setResponseStream,   setResponseWriter,   setViewRoot
Methods from java.lang.Object:
equals,   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()

    Return the Application instance associated with this web application.

 abstract public Iterator getClientIdsWithMessages()

    Return an Iterator over the client identifiers for which at least one javax.faces.application.FacesMessage has been queued. If there are no such client identifiers, an empty Iterator is returned. If any messages have been queued that were not associated with any specific client identifier, a null value will be included in the iterated values. The elements in the Iterator must be returned in the order in which they were added with #addMessage .

 public static FacesContext getCurrentInstance() 

    Return the FacesContext instance for the request that is being processed by the current thread, if any.

 public ELContext getELContext() 

    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:

    The default implementation throws UnsupportedOperationException and is provided for the sole purpose of not breaking existing applications that extend this class.

 abstract public ExternalContext getExternalContext()
 abstract public Severity getMaximumSeverity()
 abstract public Iterator getMessages()

    Return an Iterator over the javax.faces.application.FacesMessage s that have been queued, whether or not they are associated with any specific client identifier. If no such messages have been queued, return an empty Iterator. The elements of the Iterator must be returned in the order in which they were added with calls to #addMessage .

 abstract public Iterator getMessages(String clientId)

    Return an Iterator over the javax.faces.application.FacesMessage s that have been queued that are associated with the specified client identifier (if clientId is not null), or over the javax.faces.application.FacesMessage s that have been queued that are not associated with any specific client identifier (if clientId is null). If no such messages have been queued, return an empty Iterator. The elements of the Iterator must be returned in the order in which they were added with calls to #addMessage .

 abstract public RenderKit getRenderKit()

    Return the RenderKit instance for the render kit identifier specified on our UIViewRoot , if there is one. If there is no current UIViewRoot , if the UIViewRoot does not have a specified renderKitId, or if there is no RenderKit for the specified identifier, return null instead.

 abstract public boolean getRenderResponse()

    Return true if the renderResponse() method has been called for the current request.

 abstract public boolean getResponseComplete()

    Return true if the responseComplete() method has been called for the current request.

 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.

 abstract public  void release()

    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.

    The implementation must call #setCurrentInstance passing null to remove the association between this thread and this dead FacesContext instance.

 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.

 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.