Spring Web Flow

org.springframework.faces.webflow
Class FlowFacesContext

java.lang.Object
  extended by javax.faces.context.FacesContext
      extended by javax.faces.context.FacesContextWrapper
          extended by org.springframework.faces.webflow.FlowFacesContext
All Implemented Interfaces:
javax.faces.FacesWrapper<javax.faces.context.FacesContext>

public class FlowFacesContext
extends javax.faces.context.FacesContextWrapper

Custom FacesContext implementation that delegates all standard FacesContext messaging functionality to a Spring MessageSource made accessible as part of the current Web Flow request. Additionally, it manages the renderResponse flag in flash scope so that the execution of the JSF Lifecycle may span multiple requests in the case of the POST+REDIRECT+GET pattern being enabled.

Author:
Jeremy Grelle, Phillip Webb, Rossen Stoyanchev
See Also:
FlowExternalContext

Nested Class Summary
static class FlowFacesContext.FacesMessageSource
          A Spring Message Source that originated from JSF.
protected static class FlowFacesContext.FlowFacesMessage
          Adapter class to convert a FacesMessage to a Spring Message.
 
Constructor Summary
FlowFacesContext(RequestContext context, javax.faces.context.FacesContext wrapped)
           
 
Method Summary
 void addMessage(java.lang.String clientId, javax.faces.application.FacesMessage message)
          Translates a FacesMessage to a Spring Web Flow message and adds it to the current MessageContext
 java.util.Iterator<java.lang.String> getClientIdsWithMessages()
          Returns an Iterator for all component clientId's for which messages have been added.
 javax.el.ELContext getELContext()
           
 javax.faces.context.ExternalContext getExternalContext()
           
 javax.faces.application.FacesMessage.Severity getMaximumSeverity()
          Return the maximum severity level recorded on any FacesMessages that has been queued, whether or not they are associated with any specific UIComponent.
 java.util.List<javax.faces.application.FacesMessage> getMessageList()
          Returns a List for all Messages in the current MessageContext that does translation to FacesMessages.
 java.util.List<javax.faces.application.FacesMessage> getMessageList(java.lang.String clientId)
          Returns a List for all Messages with the given clientId in the current MessageContext that does translation to FacesMessages.
 java.util.Iterator<javax.faces.application.FacesMessage> getMessages()
          Returns an Iterator for all Messages in the current MessageContext that does translation to FacesMessages.
 java.util.Iterator<javax.faces.application.FacesMessage> getMessages(java.lang.String clientId)
          Returns an Iterator for all Messages with the given clientId in the current MessageContext that does translation to FacesMessages.
 javax.faces.context.PartialViewContext getPartialViewContext()
           
 boolean getRenderResponse()
           
 boolean getResponseComplete()
           
 javax.faces.context.FacesContext getWrapped()
           
 boolean isValidationFailed()
           
static FlowFacesContext newInstance(RequestContext context, javax.faces.lifecycle.Lifecycle lifecycle)
           
 void release()
           
 void renderResponse()
           
 void responseComplete()
           
 
Methods inherited from class javax.faces.context.FacesContextWrapper
getApplication, getAttributes, getCurrentPhaseId, getExceptionHandler, getRenderKit, getResponseStream, getResponseWriter, getViewRoot, isPostback, isProcessingEvents, isProjectStage, isReleased, setCurrentPhaseId, setExceptionHandler, setProcessingEvents, setResponseStream, setResponseWriter, setViewRoot, validationFailed
 
Methods inherited from class javax.faces.context.FacesContext
getCurrentInstance, setCurrentInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlowFacesContext

public FlowFacesContext(RequestContext context,
                        javax.faces.context.FacesContext wrapped)
Method Detail

getWrapped

public javax.faces.context.FacesContext getWrapped()
Specified by:
getWrapped in interface javax.faces.FacesWrapper<javax.faces.context.FacesContext>
Overrides:
getWrapped in class javax.faces.context.FacesContextWrapper

release

public void release()
Overrides:
release in class javax.faces.context.FacesContextWrapper

getExternalContext

public javax.faces.context.ExternalContext getExternalContext()
Overrides:
getExternalContext in class javax.faces.context.FacesContextWrapper

getPartialViewContext

public javax.faces.context.PartialViewContext getPartialViewContext()
Overrides:
getPartialViewContext in class javax.faces.context.FacesContextWrapper

getELContext

public javax.el.ELContext getELContext()
Overrides:
getELContext in class javax.faces.context.FacesContextWrapper

getRenderResponse

public boolean getRenderResponse()
Overrides:
getRenderResponse in class javax.faces.context.FacesContextWrapper

getResponseComplete

public boolean getResponseComplete()
Overrides:
getResponseComplete in class javax.faces.context.FacesContextWrapper

renderResponse

public void renderResponse()
Overrides:
renderResponse in class javax.faces.context.FacesContextWrapper

responseComplete

public void responseComplete()
Overrides:
responseComplete in class javax.faces.context.FacesContextWrapper

isValidationFailed

public boolean isValidationFailed()
Overrides:
isValidationFailed in class javax.faces.context.FacesContextWrapper

addMessage

public void addMessage(java.lang.String clientId,
                       javax.faces.application.FacesMessage message)
Translates a FacesMessage to a Spring Web Flow message and adds it to the current MessageContext

Overrides:
addMessage in class javax.faces.context.FacesContextWrapper

getClientIdsWithMessages

public java.util.Iterator<java.lang.String> getClientIdsWithMessages()
Returns an Iterator for all component clientId's for which messages have been added.

Overrides:
getClientIdsWithMessages in class javax.faces.context.FacesContextWrapper

getMaximumSeverity

public javax.faces.application.FacesMessage.Severity getMaximumSeverity()
Return the maximum severity level recorded on any FacesMessages that has been queued, whether or not they are associated with any specific UIComponent. If no such messages have been queued, return null.

Overrides:
getMaximumSeverity in class javax.faces.context.FacesContextWrapper

getMessages

public java.util.Iterator<javax.faces.application.FacesMessage> getMessages()
Returns an Iterator for all Messages in the current MessageContext that does translation to FacesMessages.

Overrides:
getMessages in class javax.faces.context.FacesContextWrapper

getMessageList

public java.util.List<javax.faces.application.FacesMessage> getMessageList()
Returns a List for all Messages in the current MessageContext that does translation to FacesMessages.

Overrides:
getMessageList in class javax.faces.context.FacesContextWrapper

getMessages

public java.util.Iterator<javax.faces.application.FacesMessage> getMessages(java.lang.String clientId)
Returns an Iterator for all Messages with the given clientId in the current MessageContext that does translation to FacesMessages.

Overrides:
getMessages in class javax.faces.context.FacesContextWrapper

getMessageList

public java.util.List<javax.faces.application.FacesMessage> getMessageList(java.lang.String clientId)
Returns a List for all Messages with the given clientId in the current MessageContext that does translation to FacesMessages.

Overrides:
getMessageList in class javax.faces.context.FacesContextWrapper

newInstance

public static FlowFacesContext newInstance(RequestContext context,
                                           javax.faces.lifecycle.Lifecycle lifecycle)

Spring Web Flow