|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.faces.context.FacesContext
public abstract class FacesContext
see Javadoc of JSF Specification
Constructor Summary | |
---|---|
FacesContext()
|
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 javax.el.ELContext getELContext()
A JSF implementation is expected to provide a full implementation of this class. However JSF 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 JSF1.2. Decorator classes that were written for JSF1.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 JSF 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 JSF 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 JSF implementation (Mojarra) does something similar.
public abstract Application getApplication()
public abstract Iterator<String> getClientIdsWithMessages()
public abstract ExternalContext getExternalContext()
public abstract FacesMessage.Severity getMaximumSeverity()
public abstract Iterator<FacesMessage> getMessages()
public abstract Iterator<FacesMessage> getMessages(String clientId)
public abstract RenderKit getRenderKit()
public abstract boolean getRenderResponse()
public abstract boolean getResponseComplete()
public abstract ResponseStream getResponseStream()
public abstract void setResponseStream(ResponseStream responseStream)
public abstract ResponseWriter getResponseWriter()
public abstract void setResponseWriter(ResponseWriter responseWriter)
public abstract UIViewRoot getViewRoot()
public abstract void setViewRoot(UIViewRoot root)
public abstract void addMessage(String clientId, FacesMessage message)
public abstract void release()
public abstract void renderResponse()
public abstract void responseComplete()
public static FacesContext getCurrentInstance()
protected static void setCurrentInstance(FacesContext context)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |