|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.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.
| Constructor Summary | |
FacesContext()
|
|
| Method Summary | |
abstract void |
addFacesEvent(FacesEvent event)
Append a FacesEvent to the set of events that should be
processed at the end of the current phase of the request processing
lifecycle. |
abstract void |
addMessage(UIComponent component,
Message message)
Append a Message to the set of messages associated with
the specified UIComponent, if component is
not null. |
static FacesContext |
getCurrentInstance()
Return the FacesContext instance for the request that is
being processed by the current thread. |
abstract ExternalContext |
getExternalContext()
|
abstract java.util.Iterator |
getFacesEvents()
Return an Iterator over the FacesEvents that
have been queued, in the order that they were queued. |
abstract java.util.Locale |
getLocale()
Return the Locale to be used in localizing the
response being created for this FacesContext. |
abstract int |
getMaximumSeverity()
Return the maximum severity level recorded on any Messages
that has been queued, whether or not they are associated with any
specific UIComponent. |
abstract java.util.Iterator |
getMessages()
Return an Iterator over the Messages that have
been queued, whether or not they are associated with any specific
UIComponent. |
abstract java.util.Iterator |
getMessages(UIComponent component)
Return an Iterator over the Messages that have
been queued that are associated with the specified UIComponent,
(if component is not null), or over the
Messages that have been queued that are not associated with any
specific UIComponent (if component is
null). |
abstract ResponseStream |
getResponseStream()
Return the ResponseStream to which components should
direct their binary output. |
abstract ResponseWriter |
getResponseWriter()
Return the ResponseWriter to which components should
direct their character-based output. |
abstract Tree |
getTree()
Return the component Tree that is associated with the
this request. |
abstract void |
release()
Release any resources associated with this FacesContext
instance. |
abstract void |
renderResponse()
Signal the JavaSerer 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 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 void |
setLocale(java.util.Locale locale)
Set the Locale to be used in localizing the
response being created for this FacesContext. |
abstract void |
setResponseStream(ResponseStream responseStream)
Set the ResponseStream to which components should
direct their binary output. |
abstract void |
setResponseWriter(ResponseWriter responseWriter)
Set the ResponseWriter to which components should
direct their character-based output. |
abstract void |
setTree(Tree tree)
Set the component Tree that is associated with this request. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public FacesContext()
| Method Detail |
public abstract java.util.Iterator getFacesEvents()
Return an Iterator over the FacesEvents that
have been queued, in the order that they were queued. The
Iterator returned by this method must support the
following functionality:
remove() operation may be utilized by the
JSF implementation to remove the current event when it has
been completely handled.addFacesEvent().If no events have been queued, an empty Iterator
must be returned.
public abstract java.util.Locale getLocale()
Return the Locale to be used in localizing the
response being created for this FacesContext.
public abstract void setLocale(java.util.Locale locale)
Set the Locale to be used in localizing the
response being created for this FacesContext. If not
set, the default Locale for our servlet container will be used.
locale - The new localization Localepublic abstract int getMaximumSeverity()
Return the maximum severity level recorded on any Messages
that has been queued, whether or not they are associated with any
specific UIComponent. If no such messages have been queued,
return a value less than Message.SEVERITY_INFO.
public abstract java.util.Iterator getMessages()
Return an Iterator over the Messages that have
been queued, whether or not they are associated with any specific
UIComponent. If no such messages have been queued, return an
empty Iterator.
public abstract java.util.Iterator getMessages(UIComponent component)
Return an Iterator over the Messages that have
been queued that are associated with the specified UIComponent,
(if component is not null), or over the
Messages that have been queued that are not associated with any
specific UIComponent (if component is
null). If no such messages have been queued, return an
empty Iterator.
component - The UIComponent for which messages are
requested, or null for messages not associated with
any componentpublic abstract 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.
public abstract void setResponseStream(ResponseStream responseStream)
Set the ResponseStream to which components should
direct their binary output.
responseStream - The new ResponseStream for this response
java.lang.NullPointerException - if responseStream
is nullpublic abstract 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.
public abstract void setResponseWriter(ResponseWriter responseWriter)
Set the ResponseWriter to which components should
direct their character-based output.
responseWriter - The new ResponseWriter for this response
java.lang.NullPointerException - if responseWriter
is nullpublic abstract Tree getTree()
Return the component Tree that is associated with the
this request.
public abstract void setTree(Tree tree)
Set the component Tree 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.
tree - The new component tree
java.lang.IllegalStateException - if this method is called more than
once without a call to release() in beween
java.lang.NullPointerException - if tree
is nullpublic abstract void addFacesEvent(FacesEvent event)
Append a FacesEvent to the set of events that should be
processed at the end of the current phase of the request processing
lifecycle.
event - The event to be queued
java.lang.NullPointerException - if event
is null
public abstract void addMessage(UIComponent component,
Message message)
Append a Message to the set of messages associated with
the specified UIComponent, if component is
not null. If component is null,
this Message is assumed to not be associated with any
specific component instance.
component - The component with which this message is associated
(if any)message - The message to be appended
java.lang.NullPointerException - if message
is nullpublic abstract 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.
public abstract void renderResponse()
Signal the JavaSerer 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.
public abstract 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.
public abstract ExternalContext getExternalContext()
public static FacesContext getCurrentInstance()
Return the FacesContext instance for the request that is
being processed by the current thread.
protected static void setCurrentInstance(FacesContext context)
Set the FacesContext instance for the request that is
being processed by the current thread.
context - The FacesContext instance for the current thread
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||