- java.lang.Object
-
- javax.faces.context.PartialViewContext
-
- Direct Known Subclasses:
- PartialViewContextWrapper
public abstract class PartialViewContext extends Object
PartialViewContext contains methods and properties that pertain to partial request processing and partial response rendering on a view.
The
PartialViewContext
instance is used to determine if the current request indicates the requirement to performpartial processing
and/orpartial rendering
. Partial processing is the processing of selected components through theexecute
portion of the request processing lifecycle. Partial rendering is the rendering of specified components in theRender Response Phase
of the request processing lifecycle.
-
-
Field Summary
Fields Modifier and Type Field and Description static String
ALL_PARTIAL_PHASE_CLIENT_IDS
The value that when used with
PARTIAL_EXECUTE_PARAM_NAME
orPARTIAL_RENDER_PARAM_NAME
indicates these phases must be skipped.static String
PARTIAL_EXECUTE_PARAM_NAME
The request parameter name whose request parameter value is a
Collection
of client identifiers identifying the components that must be processed during the Apply Request Values, Process Validations, and Update Model Values phases of the request processing lifecycle.static String
PARTIAL_RENDER_PARAM_NAME
The request parameter name whose request parameter value is a
Collection
of client identifiers identifying the components that must be processed during the Render Response phase of the request processing lifecycle.static String
RESET_VALUES_PARAM_NAME
If the request parameter named by the value of this constant has a parameter value of
true
, the implementation must returntrue
fromisResetValues()
.
-
Constructor Summary
Constructors Constructor and Description PartialViewContext()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description abstract Collection<String>
getExecuteIds()
Return a
Collection
of client identifiers from the current request with the request parameter namePARTIAL_EXECUTE_PARAM_NAME
.abstract PartialResponseWriter
getPartialResponseWriter()
Return the
ResponseWriter
to which components should direct their output for partial view rendering.abstract Collection<String>
getRenderIds()
Return a
Collection
of client identifiers from the current request with the request parameter namePARTIAL_RENDER_PARAM_NAME
.abstract boolean
isAjaxRequest()
Return
true
if the request headerFaces-Request
is present with the valuepartial/ajax
.abstract boolean
isExecuteAll()
Return
true
ifisAjaxRequest()
returnstrue
andPARTIAL_EXECUTE_PARAM_NAME
is present in the current request with the valueALL_PARTIAL_PHASE_CLIENT_IDS
.abstract boolean
isPartialRequest()
Return
true
isAjaxRequest()
returnstrue
or if the request headerFaces-Request
is present with the valuepartial/process
.abstract boolean
isRenderAll()
Return
true
ifisAjaxRequest()
returnstrue
andPARTIAL_RENDER_PARAM_NAME
is present in the current request with the valueALL_PARTIAL_PHASE_CLIENT_IDS
.boolean
isResetValues()
Return
true
if the incoming request has a parameter named by the value ofRESET_VALUES_PARAM_NAME
and that value istrue
.abstract void
processPartial(PhaseId phaseId)
Perform lifecycle processing on components during the indicated
phaseId
.abstract void
release()
Release any resources associated with thisPartialViewContext
instance.abstract void
setPartialRequest(boolean isPartialRequest)
Dynamically indicate that this is a partial request.
abstract void
setRenderAll(boolean renderAll)
Indicate the entire view must be rendered if
renderAll
istrue
.
-
-
-
Field Detail
-
PARTIAL_RENDER_PARAM_NAME
public static final String PARTIAL_RENDER_PARAM_NAME
The request parameter name whose request parameter value is a
Collection
of client identifiers identifying the components that must be processed during the Render Response phase of the request processing lifecycle.- Since:
- 2.0
- See Also:
- Constant Field Values
-
PARTIAL_EXECUTE_PARAM_NAME
public static final String PARTIAL_EXECUTE_PARAM_NAME
The request parameter name whose request parameter value is a
Collection
of client identifiers identifying the components that must be processed during the Apply Request Values, Process Validations, and Update Model Values phases of the request processing lifecycle.- Since:
- 2.0
- See Also:
- Constant Field Values
-
RESET_VALUES_PARAM_NAME
public static final String RESET_VALUES_PARAM_NAME
If the request parameter named by the value of this constant has a parameter value of
true
, the implementation must returntrue
fromisResetValues()
.- Since:
- 2.2
- See Also:
- Constant Field Values
-
ALL_PARTIAL_PHASE_CLIENT_IDS
public static final String ALL_PARTIAL_PHASE_CLIENT_IDS
The value that when used with
PARTIAL_EXECUTE_PARAM_NAME
orPARTIAL_RENDER_PARAM_NAME
indicates these phases must be skipped.- Since:
- 2.0
- See Also:
- Constant Field Values
-
-
Method Detail
-
getExecuteIds
public abstract Collection<String> getExecuteIds()
Return a
Collection
of client identifiers from the current request with the request parameter namePARTIAL_EXECUTE_PARAM_NAME
. If there is no such request parameter, return an emptyCollection
. These client identifiers are used to identify components that will be processed during theexecute
phase of the request processing lifecycle. The returnedCollection
is mutable.- Throws:
IllegalStateException
- if this method is called after this instance has been released- Since:
- 2.0
-
getRenderIds
public abstract Collection<String> getRenderIds()
Return a
Collection
of client identifiers from the current request with the request parameter namePARTIAL_RENDER_PARAM_NAME
. If there is no such request parameter, return an emptyCollection
. These client identifiers are used to identify components that will be processed during therender
phase of the request processing lifecycle. The returnedCollection
is mutable.- Throws:
IllegalStateException
- if this method is called after this instance has been released- Since:
- 2.0
-
getPartialResponseWriter
public abstract PartialResponseWriter getPartialResponseWriter()
Return the
ResponseWriter
to which components should direct their output for partial view rendering. Within a given response, components can use either the ResponseStream or the ResponseWriter, but not both.- Throws:
IllegalStateException
- if this method is called after this instance has been released- Since:
- 2.0
-
isAjaxRequest
public abstract boolean isAjaxRequest()
Return
true
if the request headerFaces-Request
is present with the valuepartial/ajax
. Otherwise, returnfalse
.- Throws:
IllegalStateException
- if this method is called after this instance has been released- Since:
- 2.0
-
isPartialRequest
public abstract boolean isPartialRequest()
Return
true
isAjaxRequest()
returnstrue
or if the request headerFaces-Request
is present with the valuepartial/process
. Otherwise, returnfalse
.- Throws:
IllegalStateException
- if this method is called after this instance has been released- Since:
- 2.0
-
isExecuteAll
public abstract boolean isExecuteAll()
Return
Otherwise, returntrue
ifisAjaxRequest()
returnstrue
andPARTIAL_EXECUTE_PARAM_NAME
is present in the current request with the valueALL_PARTIAL_PHASE_CLIENT_IDS
.false
.- Throws:
IllegalStateException
- if this method is called after this instance has been released- Since:
- 2.0
-
isRenderAll
public abstract boolean isRenderAll()
Return
Otherwise, returntrue
ifisAjaxRequest()
returnstrue
andPARTIAL_RENDER_PARAM_NAME
is present in the current request with the valueALL_PARTIAL_PHASE_CLIENT_IDS
.false
.- Throws:
IllegalStateException
- if this method is called after this instance has been released- Since:
- 2.0
-
isResetValues
public boolean isResetValues()
Return
true
if the incoming request has a parameter named by the value ofRESET_VALUES_PARAM_NAME
and that value istrue
. To preserve backward compatibility with custom implementations that may have extended from an earlier version of this class, an implementation is provided that returnsfalse
. A compliant implementation must override this method to take the specified action.- Since:
- 2.2
-
setRenderAll
public abstract void setRenderAll(boolean renderAll)
Indicate the entire view must be rendered if
renderAll
istrue
.- Parameters:
renderAll
- the valuetrue
indicates the entire view must be rendered.- Throws:
IllegalStateException
- if this method is called after this instance has been released- Since:
- 2.0
-
setPartialRequest
public abstract void setPartialRequest(boolean isPartialRequest)
Dynamically indicate that this is a partial request.
- Parameters:
isPartialRequest
- the valuetrue
indicates this is a partial request.- Throws:
IllegalStateException
- if this method is called after this instance has been released- Since:
- 2.0
-
release
public abstract void release()
Release any resources associated with this
PartialViewContext
instance.- Throws:
IllegalStateException
- if this method is called after this instance has been released
-
processPartial
public abstract void processPartial(PhaseId phaseId)
Perform lifecycle processing on components during the indicated
phaseId
. Only those components with identifiers existing in theCollection
returned fromgetExecuteIds()
andgetRenderIds()
will be processed.- Parameters:
phaseId
- thePhaseId
that indicates the lifecycle phase the components will be processed in.
-
-
Document created the 11/06/2005, last modified the 18/08/2025
Source of the printed document:https://www.gaudry.be/en/java-api-javaee-rf-javax/faces/context/PartialViewContext.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author of this site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.