Package org.apache.myfaces.context.flash
Class FlashImpl
java.lang.Object
jakarta.faces.context.Flash
org.apache.myfaces.context.flash.FlashImpl
- All Implemented Interfaces:
- Map<String,,- Object> - ReleasableFlash
Implementation of Flash object
- 
Nested Class Summary
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringKey to store the value of the redirect cookieFields inherited from class jakarta.faces.context.FlashNULL_VALUE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidclear()voidclearFlashMap(FacesContext facesContext, String clientWindowId, String token) booleancontainsKey(Object key) booleancontainsValue(Object value) voiddoPostPhaseActions(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).voiddoPrePhaseActions(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.entrySet()static FlashgetCurrentInstance(ExternalContext context) Return a Flash instance from the application mapstatic FlashgetCurrentInstance(ExternalContext context, boolean create) protected org.apache.myfaces.context.flash.FlashClientWindowTokenCollectiongetFlashClientWindowTokenCollection(ExternalContext externalContext, boolean create) booleanisEmpty()booleanReturns the value of a previous call to setKeepMessages() from this request.booleanReturn the value of this property for the flash for this session.voidTake 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.keySet()voidvoidThis is just an alias for the request scope map.voidsetKeepMessages(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.voidsetRedirect(boolean redirect) intsize()values()Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Mapcompute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
- 
Field Details- 
FLASH_PREVIOUS_REQUEST_REDIRECTKey to store the value of the redirect cookie- See Also:
 
 
- 
- 
Constructor Details- 
FlashImpl
 
- 
- 
Method Details- 
getCurrentInstanceReturn a Flash instance from the application map- Parameters:
- context-
- Returns:
 
- 
getCurrentInstance
- 
doPrePhaseActionsUsed 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:
- doPrePhaseActionsin class- Flash
 
- 
doPostPhaseActionsUsed 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:
- doPostPhaseActionsin class- Flash
 
- 
isRedirectpublic 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:
- isRedirectin class- Flash
 
- 
setRedirectpublic void setRedirect(boolean redirect) - Specified by:
- setRedirectin class- Flash
 
- 
keepTake 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.
- 
putNowThis is just an alias for the request scope map.
- 
isKeepMessagespublic 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:
- isKeepMessagesin class- Flash
 
- 
setKeepMessagespublic 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:
- setKeepMessagesin class- Flash
 
- 
clearpublic void clear()
- 
containsKey- Specified by:
- containsKeyin interface- Map<String,- Object> 
 
- 
containsValue- Specified by:
- containsValuein interface- Map<String,- Object> 
 
- 
entrySet
- 
get
- 
isEmptypublic boolean isEmpty()
- 
keySet
- 
put
- 
putAll
- 
remove
- 
sizepublic int size()
- 
values
- 
getFlashClientWindowTokenCollectionprotected org.apache.myfaces.context.flash.FlashClientWindowTokenCollection getFlashClientWindowTokenCollection(ExternalContext externalContext, boolean create) 
- 
clearFlashMap- Specified by:
- clearFlashMapin interface- ReleasableFlash
 
 
-