-
Nested Class Summary
-
Field Summary
Fields inherited from class jakarta.faces.context.Flash
NULL_VALUE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
boolean
containsKey
(Object key) boolean
containsValue
(Object value) void
Called after the execution of every lifecycle phase, this method allows implementations to take the necessary actions to provide the Flash scope contract as it applies to the request procesing lifecycle.void
Called before the execution of every lifecycle phase, this method allows implementations to take the necessary actions to provide the Flash scope contract as it applies to the request procesing lifecycle.entrySet()
boolean
isEmpty()
boolean
Return the value of this JavaBeans property for the flash for this session.boolean
Return the value of this property for the flash for this session.void
Causes a value stored with a previous call toFlash.putNow(java.lang.String, java.lang.Object)
, its Jakarta Expression Language equivalent, or to the requestMap
, to be promoted to the flash so that is available on the next traversal through the lifecycle on this session.keySet()
void
void
Puts a value in the flash so that it can be accessed on this traversal of the lifecycle, rather than on the next traversal.void
setKeepMessages
(boolean newValue) Setter forkeepMessages
JavaBeans property.void
setRedirect
(boolean newValue) Setting this property totrue
indicates that the next request on this session will be a redirect.int
size()
values()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
NoOpFlash
public NoOpFlash()
-
-
Method Details
-
doPostPhaseActions
Description copied from class:Flash
Called after the execution of every lifecycle phase, this method allows implementations to take the necessary actions to provide the Flash scope contract as it applies to the request procesing lifecycle.
- Specified by:
doPostPhaseActions
in classFlash
- Parameters:
ctx
- theFacesContext
for this request.
-
doPrePhaseActions
Description copied from class:Flash
Called before the execution of every lifecycle phase, this method allows implementations to take the necessary actions to provide the Flash scope contract as it applies to the request procesing lifecycle.
- Specified by:
doPrePhaseActions
in classFlash
- Parameters:
ctx
- theFacesContext
for this request.
-
isKeepMessages
public boolean isKeepMessages()Description copied from class:Flash
Return the value of this JavaBeans property for the flash for this session. This value determines whether or not any
FacesMessage
instances queued in the currentFacesContext
must be preserved so they are accessible on the next traversal of the lifecycle on this session, regardless of the request being a redirect after post, or a normal postback.Map
accesses for the special key “keepMessages
” must return the value of this JavaBeans property.Jakarta Expression Language Usage Example
First page
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:c="jakarta.tags.core"> <!-- extra code removed --> <c:set target="#{flash}" property="keepMessages" value="true" />
Next page
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="jakarta.faces.html"> <!-- extra code removed --> <h:messages /> Any messages present on the first page must be displayed on this page.
- Specified by:
isKeepMessages
in classFlash
- Returns:
- the boolean flag whether keeping messages or not.
-
isRedirect
public boolean isRedirect()Description copied from class:Flash
Return the value of this property for the flash for this session. This must be
false
unless:-
Flash.setRedirect(boolean)
was called for the current lifecycle traversal withtrue
as the argument. -
The current lifecycle traversal for this session is in the “execute” phase and the previous traversal had
Flash.setRedirect(boolean)
called withtrue
as the argument.
- Specified by:
isRedirect
in classFlash
- Returns:
- the value of this property for the flash for this session.
-
-
keep
Description copied from class:Flash
Causes a value stored with a previous call to
Flash.putNow(java.lang.String, java.lang.Object)
, its Jakarta Expression Language equivalent, or to the requestMap
, to be promoted to the flash so that is available on the next traversal through the lifecycle on this session.- Specified by:
keep
in classFlash
- Parameters:
key
- if argumentkey
is the name of an entry previously stored to the flash on this traversal through the lifecycle via a call toFlash.putNow(java.lang.String, java.lang.Object)
, or to a set to the EL expression#{flash.now.<key>}
, or to the requestMap
, to be promoted to the flash as if a call toput()
or a set to the expression#{flash.<key>}
was being called.
-
putNow
Description copied from class:Flash
Puts a value in the flash so that it can be accessed on this traversal of the lifecycle, rather than on the next traversal. This is simply an alias for putting a value in the request map.
Jakarta Expression Language Usage Example
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:c="jakarta.tags.core"> <!-- extra code removed --> <c:set target="#{flash.now}" property="bar" value="barValue" /> <p>Value of \#{flash.now.bar}, should be barValue.</p> <h:outputText value="#{flash.now.bar}" />
-
setKeepMessages
public void setKeepMessages(boolean newValue) Description copied from class:Flash
Setter for
keepMessages
JavaBeans property. SeeFlash.isKeepMessages()
.- Specified by:
setKeepMessages
in classFlash
- Parameters:
newValue
- the new value for this property on this session.
-
setRedirect
public void setRedirect(boolean newValue) Description copied from class:Flash
Setting this property to
true
indicates that the next request on this session will be a redirect. Recall that on a redirect, the server sends a special response to the client instructing it to issue a new request to a specific URI. The implementation must insure that reading the value of this property on that request will returntrue
.Jakarta Expression Language Usage Example
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:c="jakarta.tags.core"> <!-- extra code removed --> <c:set target="#{flash}" property="redirect" value="true" />
- Specified by:
setRedirect
in classFlash
- Parameters:
newValue
- the new value for this property on this session.
-
clear
public void clear() -
containsKey
-
containsValue
-
entrySet
-
get
-
isEmpty
public boolean isEmpty() -
keySet
-
put
-
putAll
-
remove
-
size
public int size() -
values
-