Class PartialResponseWriter
- All Implemented Interfaces:
FacesWrapper<ResponseWriter>,Closeable,Flushable,Appendable,AutoCloseable
public class PartialResponseWriter extends ResponseWriterWrapper
PartialResponseWriter decorates an existing ResponseWriter to support the generation of
a partial response suitable for Ajax operations. In addition to the markup generation methods inherited from
jakarta.faces.context.ResponseWriter, this class provides methods for constructing the standard partial
response elements.
- Since:
- 2.0
-
Field Summary
Fields Modifier and Type Field Description static StringRENDER_ALL_MARKERReserved ID value to indicate entire ViewRoot.static StringVIEW_STATE_MARKERReserved ID value to indicate serialized ViewState. -
Constructor Summary
Constructors Constructor Description PartialResponseWriter(ResponseWriter writer)Create aPartialResponseWriter. -
Method Summary
Modifier and Type Method Description voiddelete(String targetId)Write a delete operation.voidendDocument()Write the end of a partial response.voidendError()Write the end of an error.voidendEval()Write the end of an eval operation.voidendExtension()Write the end of an extension operation.voidendInsert()Write the end of an insert operation.voidendUpdate()Write the end of an update operation.voidredirect(String url)Write a redirect operation.voidstartDocument()Write the start of a partial response.voidstartError(String errorName)Write the start of an error.voidstartEval()Write the start of an eval operation.voidstartExtension(Map<String,String> attributes)Write the start of an extension operation.voidstartInsertAfter(String targetId)Write the start of an insert operation where the contents will be inserted after the specified target node.voidstartInsertBefore(String targetId)Write the start of an insert operation where the contents will be inserted before the specified target node.voidstartUpdate(String targetId)Write the start of an update operation.voidupdateAttributes(String targetId, Map<String,String> attributes)Write an attribute update operation.Methods inherited from class jakarta.faces.context.ResponseWriterWrapper
cloneWithWriter, close, endCDATA, endElement, flush, getCharacterEncoding, getContentType, getWrapped, startCDATA, startElement, write, writeAttribute, writeComment, writeDoctype, writePreamble, writeText, writeText, writeText, writeURIAttribute
-
Field Details
-
RENDER_ALL_MARKER
Reserved ID value to indicate entire ViewRoot.
- Since:
- 2.0
- See Also:
- Constant Field Values
-
VIEW_STATE_MARKER
Reserved ID value to indicate serialized ViewState.
- Since:
- 2.0
- See Also:
- Constant Field Values
-
-
Constructor Details
-
PartialResponseWriter
Create a
PartialResponseWriter.- Parameters:
writer- The writer to wrap.- Since:
- 2.0
-
-
Method Details
-
startDocument
Write the start of a partial response.
If
UIViewRootis an instance ofNamingContainer, then writeUIComponent.getContainerClientId(FacesContext)as value of theidattribute of the root element.- Overrides:
startDocumentin classResponseWriterWrapper- Throws:
IOException- if an input/output error occurs- Since:
- 2.0
- See Also:
ResponseWriter.startDocument()
-
endDocument
Write the end of a partial response.
- Overrides:
endDocumentin classResponseWriterWrapper- Throws:
IOException- if an input/output error occurs- Since:
- 2.0
- See Also:
ResponseWriter.endDocument()
-
startInsertBefore
Write the start of an insert operation where the contents will be inserted before the specified target node.
- Parameters:
targetId- ID of the node insertion should occur before- Throws:
IOException- if an input/output error occurs- Since:
- 2.0
-
startInsertAfter
Write the start of an insert operation where the contents will be inserted after the specified target node.
- Parameters:
targetId- ID of the node insertion should occur after- Throws:
IOException- if an input/output error occurs- Since:
- 2.0
-
endInsert
Write the end of an insert operation.
- Throws:
IOException- if an input/output error occurs- Since:
- 2.0
-
startUpdate
Write the start of an update operation.
- Parameters:
targetId- ID of the node to be updated- Throws:
IOException- if an input/output error occurs- Since:
- 2.0
-
endUpdate
Write the end of an update operation.
- Throws:
IOException- if an input/output error occurs- Since:
- 2.0
-
updateAttributes
Write an attribute update operation.
- Parameters:
targetId- ID of the node to be updatedattributes- Map of attribute name/value pairs to be updated- Throws:
IOException- if an input/output error occurs- Since:
- 2.0
-
delete
Write a delete operation.
- Parameters:
targetId- ID of the node to be deleted- Throws:
IOException- if an input/output error occurs- Since:
- 2.0
-
redirect
Write a redirect operation.
- Parameters:
url- URL to redirect to- Throws:
IOException- if an input/output error occurs- Since:
- 2.0
-
startEval
Write the start of an eval operation.
- Throws:
IOException- if an input/output error occurs- Since:
- 2.0
-
endEval
Write the end of an eval operation.
- Throws:
IOException- if an input/output error occurs- Since:
- 2.0
-
startExtension
Write the start of an extension operation.
- Parameters:
attributes- String name/value pairs for extension element attributes- Throws:
IOException- if an input/output error occurs- Since:
- 2.0
-
endExtension
Write the end of an extension operation.
- Throws:
IOException- if an input/output error occurs- Since:
- 2.0
-
startError
Write the start of an error.
- Parameters:
errorName- Descriptive string for the error- Throws:
IOException- if an input/output error occurs- Since:
- 2.0
-
endError
Write the end of an error.
- Throws:
IOException- if an input/output error occurs- Since:
- 2.0
-