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
javax.faces.context.ResponseWriter
, this class provides
methods for constructing the standard partial response elements.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
RENDER_ALL_MARKER
Reserved ID value to indicate entire ViewRoot. |
static java.lang.String |
VIEW_STATE_MARKER
Reserved ID value to indicate serialized ViewState. |
Constructor and Description |
---|
PartialResponseWriter(ResponseWriter writer)
Create a |
Modifier and Type | Method and Description |
---|---|
void |
delete(java.lang.String targetId)
Write a delete operation. |
void |
endDocument()
Write the end of a partial response. |
void |
endError()
Write the end of an error. |
void |
endEval()
Write the end of an eval operation. |
void |
endExtension()
Write the end of an extension operation. |
void |
endInsert()
Write the end of an insert operation. |
void |
endUpdate()
Write the end of an update operation. |
void |
redirect(java.lang.String url)
Write a redirect operation. |
void |
startDocument()
Write the start of a partial response. |
void |
startError(java.lang.String errorName)
Write the start of an error. |
void |
startEval()
Write the start of an eval operation. |
void |
startExtension(java.util.Map<java.lang.String,java.lang.String> attributes)
Write the start of an extension operation. |
void |
startInsertAfter(java.lang.String targetId)
Write the start of an insert operation where the contents will be inserted after the specified target node. |
void |
startInsertBefore(java.lang.String targetId)
Write the start of an insert operation where the contents will be inserted before the specified target node. |
void |
startUpdate(java.lang.String targetId)
Write the start of an update operation. |
void |
updateAttributes(java.lang.String targetId,
java.util.Map<java.lang.String,java.lang.String> attributes)
Write an attribute update operation. |
cloneWithWriter, close, endCDATA, endElement, flush, getCharacterEncoding, getContentType, getWrapped, startCDATA, startElement, write, writeAttribute, writeComment, writeDoctype, writePreamble, writeText, writeText, writeText, writeURIAttribute
public static final java.lang.String RENDER_ALL_MARKER
Reserved ID value to indicate entire ViewRoot.
public static final java.lang.String VIEW_STATE_MARKER
Reserved ID value to indicate serialized ViewState.
public PartialResponseWriter(ResponseWriter writer)
Create a PartialResponseWriter
.
writer
- The writer to wrap.public void startDocument() throws java.io.IOException
Write the start of a partial response.
If UIViewRoot
is an instance of
NamingContainer
, then write
UIComponent.getContainerClientId(FacesContext)
as value of the
id
attribute of the root element.
startDocument
in class ResponseWriterWrapper
java.io.IOException
- if an input/output error occursResponseWriter.startDocument()
public void endDocument() throws java.io.IOException
Write the end of a partial response.
endDocument
in class ResponseWriterWrapper
java.io.IOException
- if an input/output error occursResponseWriter.endDocument()
public void startInsertBefore(java.lang.String targetId) throws java.io.IOException
Write the start of an insert operation where the contents will be inserted before the specified target node.
targetId
- ID of the node insertion should occur beforejava.io.IOException
- if an input/output error occurspublic void startInsertAfter(java.lang.String targetId) throws java.io.IOException
Write the start of an insert operation where the contents will be inserted after the specified target node.
targetId
- ID of the node insertion should occur afterjava.io.IOException
- if an input/output error occurspublic void endInsert() throws java.io.IOException
Write the end of an insert operation.
java.io.IOException
- if an input/output error occurspublic void startUpdate(java.lang.String targetId) throws java.io.IOException
Write the start of an update operation.
targetId
- ID of the node to be updatedjava.io.IOException
- if an input/output error occurspublic void endUpdate() throws java.io.IOException
Write the end of an update operation.
java.io.IOException
- if an input/output error occurspublic void updateAttributes(java.lang.String targetId, java.util.Map<java.lang.String,java.lang.String> attributes) throws java.io.IOException
Write an attribute update operation.
targetId
- ID of the node to be updatedattributes
- Map of attribute name/value pairs to be updatedjava.io.IOException
- if an input/output error occurspublic void delete(java.lang.String targetId) throws java.io.IOException
Write a delete operation.
targetId
- ID of the node to be deletedjava.io.IOException
- if an input/output error occurspublic void redirect(java.lang.String url) throws java.io.IOException
Write a redirect operation.
url
- URL to redirect tojava.io.IOException
- if an input/output error occurspublic void startEval() throws java.io.IOException
Write the start of an eval operation.
java.io.IOException
- if an input/output error occurspublic void endEval() throws java.io.IOException
Write the end of an eval operation.
java.io.IOException
- if an input/output error occurspublic void startExtension(java.util.Map<java.lang.String,java.lang.String> attributes) throws java.io.IOException
Write the start of an extension operation.
attributes
- String name/value pairs for extension element attributesjava.io.IOException
- if an input/output error occurspublic void endExtension() throws java.io.IOException
Write the end of an extension operation.
java.io.IOException
- if an input/output error occurspublic void startError(java.lang.String errorName) throws java.io.IOException
Write the start of an error.
errorName
- Descriptive string for the errorjava.io.IOException
- if an input/output error occurspublic void endError() throws java.io.IOException
Write the end of an error.
java.io.IOException
- if an input/output error occurs