Class FlashImpl

java.lang.Object
jakarta.faces.context.Flash
org.apache.myfaces.context.flash.FlashImpl
All Implemented Interfaces:
Map<String,Object>, ReleasableFlash

public class FlashImpl extends Flash implements ReleasableFlash
Implementation of Flash object
  • Field Details

    • FLASH_PREVIOUS_REQUEST_REDIRECT

      public static final String FLASH_PREVIOUS_REQUEST_REDIRECT
      Key to store the value of the redirect cookie
      See Also:
  • Constructor Details

  • Method Details

    • getCurrentInstance

      public static Flash getCurrentInstance(ExternalContext context)
      Return a Flash instance from the application map
      Parameters:
      context -
      Returns:
    • getCurrentInstance

      public static Flash getCurrentInstance(ExternalContext context, boolean create)
    • doPrePhaseActions

      public void doPrePhaseActions(FacesContext facesContext)
      Used to restore the redirect value and the FacesMessages of the previous request and to manage the flashMap tokens for this request before phase restore view starts.
      Specified by:
      doPrePhaseActions in class Flash
    • doPostPhaseActions

      public void doPostPhaseActions(FacesContext facesContext)
      Used to destroy the executeMap and to save all FacesMessages for the next request, but only if this is the last invocation of this method in the current lifecycle (if redirect phase 5, otherwise phase 6).
      Specified by:
      doPostPhaseActions in class Flash
    • isRedirect

      public boolean isRedirect()
      Return the value of this property for the flash for this session. This must be false unless: - setRedirect(boolean) was called for the current lifecycle traversal with true as the argument. - The current lifecycle traversal for this session is in the "execute" phase and the previous traversal had setRedirect(boolean) called with true as the argument.
      Specified by:
      isRedirect in class Flash
    • setRedirect

      public void setRedirect(boolean redirect)
      Specified by:
      setRedirect in class Flash
    • keep

      public void keep(String key)
      Take a value from the requestMap, or if it does not exist from the execute FlashMap, and put it on the render FlashMap, so it is visible on the next request.
      Specified by:
      keep in class Flash
    • putNow

      public void putNow(String key, Object value)
      This is just an alias for the request scope map.
      Specified by:
      putNow in class Flash
    • isKeepMessages

      public boolean isKeepMessages()
      Returns the value of a previous call to setKeepMessages() from this request. If there was no call yet, false is returned.
      Specified by:
      isKeepMessages in class Flash
    • setKeepMessages

      public void setKeepMessages(boolean keepMessages)
      If this property is true, the messages should be kept for the next request, no matter if it is a normal postback case or a POST- REDIRECT-GET case. Note that we don't have to store this value for the next request (like setRedirect()), because we will know if it was true on the next request, if we can find any stored messages in the FlashMap. (also see _saveMessages() and _restoreMessages()).
      Specified by:
      setKeepMessages in class Flash
    • clear

      public void clear()
      Specified by:
      clear in interface Map<String,Object>
    • containsKey

      public boolean containsKey(Object key)
      Specified by:
      containsKey in interface Map<String,Object>
    • containsValue

      public boolean containsValue(Object value)
      Specified by:
      containsValue in interface Map<String,Object>
    • entrySet

      public Set<Map.Entry<String,Object>> entrySet()
      Specified by:
      entrySet in interface Map<String,Object>
    • get

      public Object get(Object key)
      Specified by:
      get in interface Map<String,Object>
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Map<String,Object>
    • keySet

      public Set<String> keySet()
      Specified by:
      keySet in interface Map<String,Object>
    • put

      public Object put(String key, Object value)
      Specified by:
      put in interface Map<String,Object>
    • putAll

      public void putAll(Map<? extends String,? extends Object> m)
      Specified by:
      putAll in interface Map<String,Object>
    • remove

      public Object remove(Object key)
      Specified by:
      remove in interface Map<String,Object>
    • size

      public int size()
      Specified by:
      size in interface Map<String,Object>
    • values

      public Collection<Object> values()
      Specified by:
      values in interface Map<String,Object>
    • getFlashClientWindowTokenCollection

      protected org.apache.myfaces.context.flash.FlashClientWindowTokenCollection getFlashClientWindowTokenCollection(ExternalContext externalContext, boolean create)
    • clearFlashMap

      public void clearFlashMap(FacesContext facesContext, String clientWindowId, String token)
      Specified by:
      clearFlashMap in interface ReleasableFlash